Skip to content

Commit

Permalink
fix: switching boolean keyword not working
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreytse committed Jan 25, 2021
1 parent f17af7b commit 0133061
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion zsh-vi-mode.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,14 @@ function zvm_switch_boolean() {
local word=$1
local increase=$2
local result=
local bpos=0 epos=$#word

# Remove option prefix
if [[ $word =~ (^[+-]{0,2}) ]]; then
local prefix=${match[1]}
bpos=$mend
word=${word:$bpos}
fi

case ${(L)word} in
true) result=false;;
Expand All @@ -1369,7 +1377,7 @@ function zvm_switch_boolean() {
result=${(U)result:0:1}${result:1}
fi

echo $result 0 $#word
echo $result $bpos $epos
}

# Switch weekday keyword
Expand Down

0 comments on commit 0133061

Please sign in to comment.