about summary refs log tree commit diff
path: root/Src/Zle/zle_params.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-10-01 09:44:56 +0100
committerPeter Stephenson <pws@zsh.org>2015-10-01 09:44:56 +0100
commit8877783b2f98de67144f403e0146b6d201e98ba3 (patch)
treec8fe6c4d4fc6d7c93119c01cc300427655001ba3 /Src/Zle/zle_params.c
parent007f249a8e190306a9ef6bca2317e79004ace871 (diff)
parentbc2e73ba4c27a220a6f122cb7b9b5c6fa9996941 (diff)
downloadzsh-8877783b2f98de67144f403e0146b6d201e98ba3.tar.gz
zsh-8877783b2f98de67144f403e0146b6d201e98ba3.tar.xz
zsh-8877783b2f98de67144f403e0146b6d201e98ba3.zip
Merge branch 'master' of https://git.code.sf.net/p/zsh/code
Diffstat (limited to 'Src/Zle/zle_params.c')
-rw-r--r--Src/Zle/zle_params.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index 000bc388c..b5bb288f1 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -98,9 +98,9 @@ static const struct gsu_integer undo_change_no_gsu =
 static const struct gsu_integer undo_limit_no_gsu =
 { get_undo_limit_change, set_undo_limit_change, zleunsetfn };
 static const struct gsu_integer yankstart_gsu =
-{ get_yankstart, NULL, zleunsetfn };
+{ get_yankstart, set_yankstart, zleunsetfn };
 static const struct gsu_integer yankend_gsu =
-{ get_yankend, NULL, zleunsetfn };
+{ get_yankend, set_yankend, zleunsetfn };
 static const struct gsu_integer yankactive_gsu =
 { get_yankactive, NULL, zleunsetfn };
 
@@ -149,8 +149,8 @@ static struct zleparam {
     { "WIDGET", PM_SCALAR | PM_READONLY, GSU(widget_gsu), NULL },
     { "WIDGETFUNC", PM_SCALAR | PM_READONLY, GSU(widgetfunc_gsu), NULL },
     { "WIDGETSTYLE", PM_SCALAR | PM_READONLY, GSU(widgetstyle_gsu), NULL },
-    { "YANK_START", PM_INTEGER | PM_READONLY, GSU(yankstart_gsu), NULL },
-    { "YANK_END", PM_INTEGER | PM_READONLY, GSU(yankend_gsu), NULL },
+    { "YANK_START", PM_INTEGER, GSU(yankstart_gsu), NULL },
+    { "YANK_END", PM_INTEGER, GSU(yankend_gsu), NULL },
     { "YANK_ACTIVE", PM_INTEGER | PM_READONLY, GSU(yankactive_gsu), NULL },
     { "ZLE_STATE", PM_SCALAR | PM_READONLY, GSU(zle_state_gsu), NULL },
     { NULL, 0, NULL, NULL }
@@ -503,7 +503,21 @@ get_yankend(UNUSED(Param pm))
 static zlong
 get_yankactive(UNUSED(Param pm))
 {
-    return lastcmd & ZLE_YANK;
+    return !!(lastcmd & ZLE_YANK) + !!(lastcmd & ZLE_YANKAFTER);
+}
+
+/**/
+static void
+set_yankstart(UNUSED(Param pm), zlong i)
+{
+    yankb = i;
+}
+
+/**/
+static void
+set_yankend(UNUSED(Param pm), zlong i)
+{
+    yanke = i;
 }
 
 /**/