Skip to content

Commit

Permalink
perf: better repeating [cdy]<count>[ia][wW] (#88)
Browse files Browse the repository at this point in the history
This commit has some optimization on it, when the cursor position
is at the end and no long change, we should stop executing.
  • Loading branch information
jeffreytse committed Apr 6, 2021
1 parent cde3198 commit 196bf1b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions zsh-vi-mode.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1587,9 +1587,14 @@ function zvm_range_handler() {
if (( c == 0 )); then
mark=$MARK
fi
CURSOR=$((CURSOR+1))
if (($CURSOR >= $#BUFFER)); then
break
fi
done

MARK=$mark
CURSOR=$((CURSOR-1))
;;
*)
local retval=
Expand Down

0 comments on commit 196bf1b

Please sign in to comment.