From 2ca0cf64b2f8f4004ab329bb2e3f87a7bfd21f02 Mon Sep 17 00:00:00 2001 From: Jeffrey Tse Date: Thu, 6 Jul 2023 10:57:10 +0800 Subject: [PATCH] fix: `.` command doesn't work as expected behavior (#226) This issue was caused by wrongly escaping non-printable characters, they were converted to another characters. --- zsh-vi-mode.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zsh-vi-mode.zsh b/zsh-vi-mode.zsh index 4236de6..e4a6dcd 100644 --- a/zsh-vi-mode.zsh +++ b/zsh-vi-mode.zsh @@ -1514,11 +1514,10 @@ function zvm_range_handler() { # Exit operator pending mode zvm_exit_oppend_mode - # Escape non-printed characters (e.g. ^[) - keys=$(zvm_escape_non_printed_characters "$keys") - # Handle escape in operator pending mode - if [[ "$keys" =~ ${ZVM_VI_OPPEND_ESCAPE_BINDKEY/\^\[/\\^\\[} ]]; then + # escape non-printed characters (e.g. ^[) + if [[ $(zvm_escape_non_printed_characters "$keys") =~ + ${ZVM_VI_OPPEND_ESCAPE_BINDKEY/\^\[/\\^\\[} ]]; then return 1 fi