From 81708b70e685426716999e1278b7373292e797e9 Mon Sep 17 00:00:00 2001 From: Darshan Kumawat <104432537+darshanCommits@users.noreply.github.com> Date: Fri, 24 Jan 2025 23:16:19 +0530 Subject: [PATCH] doc: Document `mdm` and `mrm` for popup help (#12650) --- helix-term/src/commands.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index e49d752b5..ad37df406 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -5809,7 +5809,8 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) { cx.editor.autoinfo = Some(Info::new(title, &help_text)); } -static SURROUND_HELP_TEXT: [(&str, &str); 5] = [ +static SURROUND_HELP_TEXT: [(&str, &str); 6] = [ + ("m", "Nearest matching pair"), ("( or )", "Parentheses"), ("{ or }", "Curly braces"), ("< or >", "Angled brackets"), @@ -5862,12 +5863,16 @@ fn surround_add(cx: &mut Context) { exit_select_mode(cx); }); - cx.editor.autoinfo = Some(Info::new("Surround selections with", &SURROUND_HELP_TEXT)); + cx.editor.autoinfo = Some(Info::new( + "Surround selections with", + &SURROUND_HELP_TEXT[1..], + )); } fn surround_replace(cx: &mut Context) { let count = cx.count(); cx.on_next_key(move |cx, event| { + cx.editor.autoinfo = None; let surround_ch = match event.char() { Some('m') => None, // m selects the closest surround pair Some(ch) => Some(ch), @@ -5923,7 +5928,10 @@ fn surround_replace(cx: &mut Context) { exit_select_mode(cx); }); - cx.editor.autoinfo = Some(Info::new("Replace with a pair of", &SURROUND_HELP_TEXT)); + cx.editor.autoinfo = Some(Info::new( + "Replace with a pair of", + &SURROUND_HELP_TEXT[1..], + )); }); cx.editor.autoinfo = Some(Info::new(