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.
This commit is contained in:
Johannes Altmanninger 2022-07-06 16:26:36 +02:00
parent 61b09ff4a7
commit 1527edd542
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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