diff options
author | Blaž Hrastnik | 2022-06-06 15:08:47 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-06-06 15:23:40 +0000 |
commit | b14c258a2c447b892c89d3e68ef4c9a74effca85 (patch) | |
tree | 0e88e735936e48c2c82e4525fc957b3548995777 /helix-core/src | |
parent | 8351a82c2cae58dd49c654d0e878c9d7227ef9c8 (diff) |
prompt: If submitting empty prompt, use default (last used)
Diffstat (limited to 'helix-core/src')
-rw-r--r-- | helix-core/src/register.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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<char, Register> { &self.inner } |