mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Let repaint-mode act like a repaint if no fish_mode_prompt exists
Otherwise I'm pretty sure we'd get complaints from people who use a mode-indicator elsewhere in their prompts.
This commit is contained in:
parent
bc958712e4
commit
99dd6d7394
2 changed files with 10 additions and 6 deletions
|
@ -138,7 +138,7 @@ The following special input functions are available:
|
||||||
|
|
||||||
- ``repaint`` reexecutes the prompt functions and redraws the prompt. Multiple successive repaints are coalesced.
|
- ``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.
|
- ``repaint-mode`` reexecutes the fish_mode_prompt function and redraws the prompt. This is useful for vi-mode. If no fish_mode_prompt exists, it acts like a normal repaint.
|
||||||
|
|
||||||
- ``suppress-autosuggestion``, remove the current autosuggestion
|
- ``suppress-autosuggestion``, remove the current autosuggestion
|
||||||
|
|
||||||
|
|
|
@ -2514,12 +2514,16 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
|
||||||
// Repaint the mode-prompt only if it exists.
|
// Repaint the mode-prompt only if it exists.
|
||||||
// This is an optimization basically exclusively for vi-mode, since the prompt
|
// This is an optimization basically exclusively for vi-mode, since the prompt
|
||||||
// may sometimes take a while but when switching the mode all we care about is the mode-prompt.
|
// may sometimes take a while but when switching the mode all we care about is the mode-prompt.
|
||||||
|
if (function_exists(MODE_PROMPT_FUNCTION_NAME)) {
|
||||||
exec_mode_prompt();
|
exec_mode_prompt();
|
||||||
s_reset(&screen, screen_reset_current_line_and_prompt);
|
s_reset(&screen, screen_reset_current_line_and_prompt);
|
||||||
screen_reset_needed = false;
|
screen_reset_needed = false;
|
||||||
repaint();
|
repaint();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// If it doesn't exist, we repaint as normal.
|
||||||
|
/* fallthrough */
|
||||||
|
}
|
||||||
case rl::force_repaint:
|
case rl::force_repaint:
|
||||||
case rl::repaint: {
|
case rl::repaint: {
|
||||||
if (!rls.coalescing_repaints) {
|
if (!rls.coalescing_repaints) {
|
||||||
|
|
Loading…
Reference in a new issue