Skip to content

Commit 6be22d5

Browse files
committed
Move left to fix selection only when in Vi mode
Selection copy works differently in Vi and Emacs modes. Therefore its necessary to fix it in Vi by moving one character to the left. This pull request makes the fix happen only in Vi mode.
1 parent 82dd031 commit 6be22d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/copycat_jump.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ _copycat_select() {
267267
if tmux_is_at_least 2.4; then
268268
tmux send-keys -X begin-selection
269269
tmux send-keys -X -N "$length" cursor-right
270-
tmux send-keys -X cursor-left
270+
if [ "$TMUX_COPY_MODE" == "vi" ]; then
271+
tmux send-keys -X cursor-left # selection correction for 1 char
272+
fi
271273
elif [ "$TMUX_COPY_MODE" == "vi" ]; then
272274
# vi copy mode
273275
tmux send-keys Space "$length" l h # selection correction for 1 char

0 commit comments

Comments
 (0)