mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-27 16:51:15 -03:00
Remove space for prompt if it occupies full line
If the prompt occupies the full width of the first line, each new line will soft wrap, leaving empty lines between. This change removes the indentation that matches the start of the line to the end of the prompt if the prompt width equals the terminal width. Steps to reproduce: fish -C 'function fish_prompt; printf %0"$COLUMNS"d 0; end' # type "begin" and Enter # observe that there was a spurious empty line
This commit is contained in:
committed by
Johannes Altmanninger
parent
e63fea1127
commit
d667ec5061
@@ -374,8 +374,12 @@ struct ScrolledCursor {
|
||||
);
|
||||
}
|
||||
|
||||
// If overflowing, give the prompt its own line to improve the situation.
|
||||
let first_line_prompt_space = layout.left_prompt_space;
|
||||
// If the prompt doesn't occupy the full line, justify the command line to the end of the prompt.
|
||||
let first_line_prompt_space = if layout.left_prompt_space == screen_width {
|
||||
0
|
||||
} else {
|
||||
layout.left_prompt_space
|
||||
};
|
||||
|
||||
// Reconstruct the command line.
|
||||
let effective_commandline = explicit_before_suggestion.to_owned()
|
||||
|
||||
Reference in New Issue
Block a user