mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 22:21:15 -03:00
Fix completion pager rendering when there are lines after cursor
When the completion pager fills up all lines of the screen, we subtract from the pager size the number of lines occupied by the prompt + command line buffer (typically 1), so the command line is always visible. However, we only subtract the number of lines *before* the cursor, so on some multiline commandlines we draw a pager that is too large for our screen, clobbering the commandline rendering. Fix this by counting all lines. Fixes #8509 Possibly fixes #8405
This commit is contained in:
@@ -28,3 +28,14 @@ isolated-tmux capture-pane -p
|
||||
# The "bc" part is the autosuggestion - we could use "capture-pane -e" to check colors.
|
||||
# CHECK: prompt 2> foo2 aabc
|
||||
# CHECK: aabc aaBd
|
||||
|
||||
# Check that a larger-than-screen completion list does not stomp a multiline commandline (#8509).
|
||||
isolated-tmux send-keys C-u 'complete -c foo3 -fa "(seq $LINES)\t(string repeat -n $COLUMNS d)"' Enter \
|
||||
C-l begin Enter foo3 Enter "echo some trailing line" \
|
||||
C-p C-e Space Tab Tab
|
||||
tmux-sleep
|
||||
isolated-tmux capture-pane -p | sed -n '1p;$p'
|
||||
# Assert that we didn't change the command line.
|
||||
# CHECK: prompt 3> begin
|
||||
# Also ensure that the pager is actually fully disclosed.
|
||||
# CHECK: rows 1 to 6 of 10
|
||||
|
||||
Reference in New Issue
Block a user