summaryrefslogtreecommitdiff
path: root/Src/Zle/textobjects.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2016-12-04 04:32:03 +0100
committerAxel Beckert <abe@deuxchevaux.org>2016-12-04 04:32:03 +0100
commit3e439c3863f14c82f70666804c8570a13b3732e6 (patch)
tree07036c43e0f3f9242bb6dd42cd2a849ec8ea8aca /Src/Zle/textobjects.c
parent2aedc4b88fd0e87b89583983951b04b96f48efd3 (diff)
parent7b7e84f0815ed22a0ee348a217776529035dccf3 (diff)
downloadzsh-3e439c3863f14c82f70666804c8570a13b3732e6.tar.gz
zsh-3e439c3863f14c82f70666804c8570a13b3732e6.zip
Merge tag 'zsh-5.2-test-1' into debian
Diffstat (limited to 'Src/Zle/textobjects.c')
-rw-r--r--Src/Zle/textobjects.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Src/Zle/textobjects.c b/Src/Zle/textobjects.c
index 9b3277a97..3db0781ff 100644
--- a/Src/Zle/textobjects.c
+++ b/Src/Zle/textobjects.c
@@ -1,5 +1,5 @@
/*
- * textobjects.c - ZLE module implementing Vim style text objects
+ * textobjects.c - ZLE widgets implementing Vim style text objects
*
* This file is part of zsh, the Z shell.
*
@@ -54,11 +54,7 @@ selectword(UNUSED(char **args))
int sclass = viclass(zleline[zlecs]);
int doblanks = all && sclass;
- if (!invicmdmode()) {
- region_active = 1;
- mark = zlecs;
- }
- if (!region_active || zlecs == mark) {
+ if (!region_active || zlecs == mark || mark == -1) {
/* search back to first character of same class as the start position
* also stop at the beginning of the line */
mark = zlecs;
@@ -207,8 +203,12 @@ selectword(UNUSED(char **args))
/* Adjustment: vi operators don't include the cursor position, in insert
* or emacs mode the region also doesn't but for vi visual mode it is
* included. */
- if (zlecs && zlecs > mark && !virangeflag)
- DECCS();
+ if (!virangeflag) {
+ if (!invicmdmode())
+ region_active = 1;
+ else if (zlecs && zlecs > mark)
+ DECCS();
+ }
return 0;
}
@@ -315,7 +315,7 @@ selectargument(UNUSED(char **args))
}
/* Adjustment: vi operators don't include the cursor position */
- if (!virangeflag)
+ if (!virangeflag && invicmdmode())
DECCS();
return 0;