mirror of
https://github.com/tmux/tmux.git
synced 2026-10-12 21:54:23 +00:00
Preserve the copy-mode entry column after trailing blanks
This commit is contained in:
@@ -137,6 +137,51 @@ x cursor-up
|
||||
check_cursor 7,0
|
||||
x cancel
|
||||
|
||||
# Trailing blanks must not replace the initial preference on the first move.
|
||||
for entry_line in 'prompt> ' ' '; do
|
||||
$TMUX respawn-pane -k \
|
||||
"printf '\033[H\033[2J'; \
|
||||
printf '%s\r\n' ABCDEFGHIJKLMNOPQRST abc ABCDEFGHIJKLMNOPQRST \
|
||||
'$entry_line' ABCDEFGHIJKLMNOP ab 01234567890123456789; \
|
||||
printf '\033[4;9H'; exec cat" || fail "respawn-pane failed"
|
||||
wait_cursor 8,3
|
||||
for mode in emacs vi; do
|
||||
$TMUX set-window-option -g mode-keys "$mode" ||
|
||||
fail "set mode-keys failed"
|
||||
for direction in up down; do
|
||||
if [ "$direction" = up ]; then
|
||||
row=2
|
||||
end=20
|
||||
short=3
|
||||
last=0
|
||||
else
|
||||
row=4
|
||||
end=16
|
||||
short=2
|
||||
last=6
|
||||
fi
|
||||
[ "$mode" = emacs ] || end=$((end - 1))
|
||||
$TMUX copy-mode || fail "copy-mode failed"
|
||||
x "cursor-$direction"
|
||||
check_cursor "$end,$row"
|
||||
x cancel
|
||||
|
||||
$TMUX copy-mode -c || fail "copy-mode -c failed"
|
||||
check_cursor 8,3
|
||||
x "cursor-$direction"
|
||||
check_cursor "8,$row"
|
||||
x "cursor-$direction"
|
||||
x "cursor-$direction"
|
||||
if [ "$mode" = emacs ]; then
|
||||
check_cursor "8,$last"
|
||||
else
|
||||
check_cursor "$((short - 1)),$last"
|
||||
fi
|
||||
x cancel
|
||||
done
|
||||
done
|
||||
done
|
||||
|
||||
# An empty entry line has a numeric column zero with -c.
|
||||
$TMUX respawn-pane -k \
|
||||
"printf '\033[H\033[2JABCDEFGHIJKLMNOPQRST\033[2;1H'; exec cat" ||
|
||||
@@ -172,7 +217,7 @@ done
|
||||
# Initialize before the optional entry-time page movement.
|
||||
$TMUX respawn-pane -k \
|
||||
"printf '\033[H\033[2JABCDEFGHIJKLMNOPQRST'; \
|
||||
printf '\033[9;1Habcdefgh\033[10;1HABCDEFGHIJKLMNOP\033[9;9H'; \
|
||||
printf '\033[9;1Hprompt> \033[10;1HABCDEFGHIJKLMNOP\033[9;9H'; \
|
||||
exec cat" ||
|
||||
fail "respawn-pane failed"
|
||||
wait_cursor 8,8
|
||||
|
||||
Reference in New Issue
Block a user