Skip to content

Commit

Permalink
fix: exiting range operation will remove a letter (#62)
Browse files Browse the repository at this point in the history
This commit fixed the issue that exiting the range operator pending
status (e.g. stroking df<ESC>) will remove a letter at cursor position.
  • Loading branch information
jeffreytse committed Mar 23, 2021
1 parent 4696b90 commit 2565851
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zsh-vi-mode.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,7 @@ function zvm_range_handler() {
# [cdy]Ff -> `foo.ba`
# [cdyv]tz -> `r.ba`
# [cdy]Tf -> `oo.ba`
#

# Pre navigation handling
local navkey="${keys:1}"
Expand Down Expand Up @@ -1253,6 +1254,12 @@ function zvm_range_handler() {
*) zvm_navigation_handler "${navkey}"
esac

# Check if there is no range selected
if ((cursor == CURSOR)) && [[ $mode == $ZVM_MODE_VISUAL ]]; then
zvm_exit_visual_mode
return
fi

# Post navigation handling
case "${keys}" in
[cdy]*i[wW]) cursor=$MARK;;
Expand Down

0 comments on commit 2565851

Please sign in to comment.