From b14c258a2c447b892c89d3e68ef4c9a74effca85 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Tue, 7 Jun 2022 00:08:47 +0900 Subject: prompt: If submitting empty prompt, use default (last used) --- helix-core/src/register.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'helix-core') diff --git a/helix-core/src/register.rs b/helix-core/src/register.rs index b39e4034..7fa34644 100644 --- a/helix-core/src/register.rs +++ b/helix-core/src/register.rs @@ -69,6 +69,10 @@ impl Registers { self.get(name).map(|reg| reg.read()) } + pub fn first(&self, name: char) -> Option<&String> { + self.read(name).and_then(|entries| entries.first()) + } + pub fn inner(&self) -> &HashMap { &self.inner } -- cgit v1.2.3-70-g09d2