about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2015-08-11 13:28:14 +0200
committerOliver Kiddle <opk@zsh.org>2015-08-11 13:28:14 +0200
commit3183cbd98c6f980a1d0d15227b12cf1caeb54e33 (patch)
tree4fa5ae2dd9caa90f66e393a6ff69c5012ce38457 /Src
parent0f224e72cc0ffaf72ec18c88611c41b33f2be955 (diff)
downloadzsh-3183cbd98c6f980a1d0d15227b12cf1caeb54e33.tar.gz
zsh-3183cbd98c6f980a1d0d15227b12cf1caeb54e33.tar.xz
zsh-3183cbd98c6f980a1d0d15227b12cf1caeb54e33.zip
36044: deactivate-region widget for escape in visual mode
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/iwidgets.list1
-rw-r--r--Src/Zle/zle_keymap.c1
-rw-r--r--Src/Zle/zle_move.c7
3 files changed, 9 insertions, 0 deletions
diff --git a/Src/Zle/iwidgets.list b/Src/Zle/iwidgets.list
index 657e4ef27..2b2654c5d 100644
--- a/Src/Zle/iwidgets.list
+++ b/Src/Zle/iwidgets.list
@@ -35,6 +35,7 @@
 "copy-prev-word", copyprevword, ZLE_KEEPSUFFIX
 "copy-prev-shell-word", copyprevshellword, ZLE_KEEPSUFFIX
 "copy-region-as-kill", copyregionaskill, ZLE_KEEPSUFFIX
+"deactivate-region", deactivateregion, 0
 "delete-char", deletechar, ZLE_KEEPSUFFIX
 "delete-char-or-list", deletecharorlist, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_ISCOMP
 "delete-word", deleteword, ZLE_KEEPSUFFIX
diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index d355f41a4..c16e32e1b 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -1363,6 +1363,7 @@ default_bindings(void)
     }
     /* escape in operator pending cancels the operation */
     bindkey(oppmap, "\33", refthingy(t_vicmdmode), NULL);
+    bindkey(vismap, "\33", refthingy(t_deactivateregion), NULL);
     bindkey(vismap, "o", refthingy(t_exchangepointandmark), NULL);
     bindkey(vismap, "p", refthingy(t_putreplaceselection), NULL);
     bindkey(vismap, "x", refthingy(t_videlete), NULL);
diff --git a/Src/Zle/zle_move.c b/Src/Zle/zle_move.c
index d751c4333..cf8f34595 100644
--- a/Src/Zle/zle_move.c
+++ b/Src/Zle/zle_move.c
@@ -555,6 +555,13 @@ visuallinemode(UNUSED(char **args))
     return 0;
 }
 
+/**/
+int
+deactivateregion(UNUSED(char **args))
+{
+    region_active = 0;
+    return 0;
+}
 
 /**/
 int