Add repaint-mode bind function

If we switch the bind mode, we add a "force-repaint" there just to
redraw the mode indicator.

That's quite wasteful and annoying, considering that sometimes the prompt can take
half a second.

So we add a "repaint-mode" function that just reexecutes the
mode-prompt and uses the cached values for the others.

Fixes #5783.
This commit is contained in:
Fabian Homborg
2019-04-01 15:52:21 +02:00
parent da1b32f0ad
commit 8ff866b26b
5 changed files with 73 additions and 50 deletions

View File

@@ -136,6 +136,10 @@ The following special input functions are available:
- ``pager-toggle-search``, toggles the search field if the completions pager is visible.
- ``repaint`` reexecutes the prompt functions and redraws the prompt. Multiple successive repaints are coalesced.
- ``repaint-mode`` reexecutes the fish_mode_prompt function and redraws the prompt. This is useful for vi-mode.
- ``suppress-autosuggestion``, remove the current autosuggestion
- ``swap-selection-start-stop``, go to the other end of the highlighted text without changing the selection