From 1527edd5428372c4f24de4398f249fd7bc589bd6 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 6 Jul 2022 16:26:36 +0200 Subject: [PATCH] Stop printing extra newline when Alt-W or Alt-L is used with a multiline prompt When we want to print something while the prompt is still active, we move the cursor by printing a newline for each line in the prompt beyond the first one. As established by 80fe0a7fc (fish_job_summary: Format message better for multiline prompts, 2022-06-28), our use of "string repeat" actually prints an extra newline. Let's remove it here as well. --- share/functions/__fish_list_current_token.fish | 2 +- share/functions/__fish_whatis_current_token.fish | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_list_current_token.fish b/share/functions/__fish_list_current_token.fish index b6c004b19..1bfabd92f 100644 --- a/share/functions/__fish_list_current_token.fish +++ b/share/functions/__fish_list_current_token.fish @@ -15,7 +15,7 @@ function __fish_list_current_token -d "List contents of token under the cursor i end end - string repeat \n --count=(math (count (fish_prompt)) - 1) + string repeat -N \n --count=(math (count (fish_prompt)) - 1) commandline -f repaint end diff --git a/share/functions/__fish_whatis_current_token.fish b/share/functions/__fish_whatis_current_token.fish index 390ec98cb..62cf09fbb 100644 --- a/share/functions/__fish_whatis_current_token.fish +++ b/share/functions/__fish_whatis_current_token.fish @@ -28,7 +28,7 @@ function __fish_whatis_current_token -d "Show man page entries or function descr printf "%s\n" $desc - string repeat \n --count=(math (count (fish_prompt)) - 1) + string repeat -N \n --count=(math (count (fish_prompt)) - 1) commandline -f repaint end