Unnamed repository; edit this file 'description' to name the repository.
commands: Eagerly clear autoinfo in select_register, insert_register
This causes the infobox to disappear even when you type a non-character key like escape. For example `"<esc>` now clears the infobox where before it was left hanging.
Michael Davis 2025-02-03
parent ebdab86 · commit e882a75
-rw-r--r--helix-term/src/commands.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 23d2b246..cd296f86 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -5545,8 +5545,8 @@ fn wonly(cx: &mut Context) {
fn select_register(cx: &mut Context) {
cx.editor.autoinfo = Some(Info::from_registers(&cx.editor.registers));
cx.on_next_key(move |cx, event| {
+ cx.editor.autoinfo = None;
if let Some(ch) = event.char() {
- cx.editor.autoinfo = None;
cx.editor.selected_register = Some(ch);
}
})
@@ -5555,8 +5555,8 @@ fn select_register(cx: &mut Context) {
fn insert_register(cx: &mut Context) {
cx.editor.autoinfo = Some(Info::from_registers(&cx.editor.registers));
cx.on_next_key(move |cx, event| {
+ cx.editor.autoinfo = None;
if let Some(ch) = event.char() {
- cx.editor.autoinfo = None;
cx.register = Some(ch);
paste(
cx.editor,