mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-19 13:01:15 -03:00
Have the pager use a simple newline count to determine reserved lines
When the pager wants to use the full screen to show many options, it reserves space at the top to see the command. Previously it pretended the command was a prompt and engaged the prompt layout mechanism to compute these lines. Instead let's juts count newlines since escape sequences within commands are very rare.
This commit is contained in:
@@ -346,7 +346,7 @@ static prompt_layout_t calc_prompt_layout(const wchar_t *prompt, prompt_type_t w
|
||||
return prompt_layout;
|
||||
}
|
||||
|
||||
size_t calc_prompt_lines(const wcstring &prompt) {
|
||||
static size_t calc_prompt_lines(const wcstring &prompt) {
|
||||
// Hack for the common case where there's no newline at all. I don't know if a newline can
|
||||
// appear in an escape sequence, so if we detect a newline we have to defer to
|
||||
// calc_prompt_width_and_lines.
|
||||
|
||||
Reference in New Issue
Block a user