From b13d44156c0f2ebe700c4169e87839c976c4fedc Mon Sep 17 00:00:00 2001 From: Daniel S Poulin Date: Mon, 28 Feb 2022 20:29:22 -0500 Subject: Show infobox to hint textobjects with `mi` and `ma` (#1686) * Show infobox to hint textobjects with `mi` and `ma` * Add note to infobox than any pair of characters will work too The wording could probably be a little more clear, but I wanted to keep it short but still accurate. * Don't allocate a vec for the static help text * Fix bug where `mi` would swallow next input and persist infobox * Better help text for arbitrary pair matching in textobject selection * Add way to add fake pending key data below status, use with `mi`/`ma` This is a bit hacky as it makes use of global state which will end up managed in multiple places, but has precedent in the way autoinfo works. There should probably be a bigger refactor to handle this kind of state better. * Return early on anything other than `mi` and `ma` for autoinfo * Remove "ascii" from help text with `mi` and `ma` * Update helix-term/src/ui/editor.rs Co-authored-by: Blaž Hrastnik --- helix-term/src/ui/editor.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'helix-term/src/ui/editor.rs') diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 29552b67..064c74ee 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -1211,6 +1211,9 @@ impl Component for EditorView { disp.push_str(&s); } } + if let Some(pseudo_pending) = &cx.editor.pseudo_pending { + disp.push_str(pseudo_pending.as_str()) + } let style = cx.editor.theme.get("ui.text"); let macro_width = if cx.editor.macro_recording.is_some() { 3 -- cgit v1.2.3-70-g09d2