aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/register.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core/src/register.rs')
-rw-r--r--helix-core/src/register.rs4
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
}