summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-04-20 16:57:21 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-04-20 16:57:21 +0000
commitdea42c692fecdd7e0e867f26f25cdc300dafbf2b (patch)
treed1f38590ec278e2401cd7262dec984fd5330aa40 /Src
parentb404fc3aeb7486f1423f54ae7a2914a0425adbac (diff)
downloadzsh-dea42c692fecdd7e0e867f26f25cdc300dafbf2b.tar.gz
zsh-dea42c692fecdd7e0e867f26f25cdc300dafbf2b.tar.xz
zsh-dea42c692fecdd7e0e867f26f25cdc300dafbf2b.zip
24852: more combining chars fallout
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_main.c2
-rw-r--r--Src/Zle/zle_vi.c19
2 files changed, 14 insertions, 7 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 440f0cf8a..713221d0d 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1051,7 +1051,7 @@ zlecore(void)
 	    /* for vi mode, make sure the cursor isn't somewhere illegal */
 	    if (invicmdmode() && zlecs > findbol() &&
 		(zlecs == zlell || zleline[zlecs] == ZWC('\n')))
-		zlecs--;
+		DECCS();
 	    if (undoing)
 		handleundo();
 	} else {
diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c
index c807da359..b8c3936d4 100644
--- a/Src/Zle/zle_vi.c
+++ b/Src/Zle/zle_vi.c
@@ -353,10 +353,14 @@ videletechar(char **args)
 	return 1;
     /* Put argument into the acceptable range -- it is not an error to  *
      * specify a greater count than the number of available characters. */
-    if (n > findeol() - zlecs)
+    /* HERE: we should do the test properly with INCPOS(). */
+    if (n > findeol() - zlecs) {
 	n = findeol() - zlecs;
-    /* do the deletion */
-    forekill(n, CUT_RAW);
+	/* do the deletion */
+	forekill(n, CUT_RAW);
+    } else {
+	forekill(n, 0);
+    }
     return 0;
 }
 
@@ -714,10 +718,13 @@ vibackwarddeletechar(char **args)
     }
     /* Put argument into the acceptable range -- it is not an error to  *
      * specify a greater count than the number of available characters. */
-    if (n > zlecs - findbol())
+    /* HERE: we should do the test properly with DECPOS(). */
+    if (n > zlecs - findbol()) {
 	n = zlecs - findbol();
-    /* do the deletion */
-    backkill(n, CUT_FRONT|CUT_RAW);
+	/* do the deletion */
+	backkill(n, CUT_FRONT|CUT_RAW);
+    } else
+	backkill(n, CUT_FRONT);
     return 0;
 }