Closed olivierlemoal closed 4 years ago
Thanks for this nice little script. It looks like the {cursor} feature in template is broken because of set -o errexit on https://github.com/BarbUk/dotfiles/blob/master/bin/snippy#L133
set -o errexit
It works fine with
move_cursor() { local key=$1 local count=$2 local keys="End " if [[ $count -gt 0 ]]; then until [ "$count" -eq 0 ]; do keys+="${key} " let "count--" done # shellcheck disable=SC2086 xdotool key --delay 0.1 $keys fi }
Good catch. It's because ((expr)) return an exit code when the result is 0:
$ count=2 $ ((count-=1)) $ echo $? 0 $ ((count-=1)) $ echo $? 1
Thanks for this nice little script. It looks like the {cursor} feature in template is broken because of
set -o errexit
on https://github.com/BarbUk/dotfiles/blob/master/bin/snippy#L133It works fine with