about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Doc/Zsh/zle.yo17
-rw-r--r--Src/Zle/zle_main.c2
3 files changed, 15 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index e89a494c5..be387302c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-07-17  Oliver Kiddle  <opk@zsh.org>
+
+	* 38845: Src/Zle/zle_main.c, Doc/Zsh/zle.yo: reset region_active
+	before entering zle - it was on exit but before zle-line-finish
+	Also reword documentation on region to better cover vi mode
+
 2016-07-13  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* 38850: Functions/Zle/add-zle-hook-widget: Simplify indexing
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index f51eadac5..1642c5b15 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -2571,15 +2571,14 @@ When one of the incremental history search widgets is active, the
 area of the command line matched by the search string or pattern.
 )
 item(tt(region))(
-The region between the cursor (point) and the mark as set with
-tt(set-mark-command).  The region is only highlighted if it is active,
-which is the case if tt(set-mark-command) or tt(exchange-point-and-mark)
-has been called and the line has not been subsequently modified.  The
-region can be deactivated by calling tt(set-mark-command) with a
-negative numeric argument, or reactivated by calling
-tt(exchange-point-and-mark) with a zero numeric argument.  Note
-that whether or not the region is active has no effect on its
-use within widgets, it simply determines whether it is highlighted.
+The currently selected text. In emacs terminology, this is referred to as
+the region and is bounded by the cursor (point) and the mark. The region
+is only highlighted if it is active, which is the case after the mark
+is modified with tt(set-mark-command) or tt(exchange-point-and-mark).
+Note that whether or not the region is active has no effect on its
+use within emacs style widgets, it simply determines whether it is
+highlighted. In vi mode, the region corresponds to selected text in
+visual mode.
 )
 cindex(special characters, highlighting)
 cindex(highlighting, special characters)
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 472e326d1..ac31d4e09 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1159,7 +1159,6 @@ zlecore(void)
 
     }
 
-    region_active = 0;
     popheap();
 }
 
@@ -1292,6 +1291,7 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish)
     lastcol = -1;
     initmodifier(&zmod);
     prefixflag = 0;
+    region_active = 0;
 
     zrefresh();