From dea42c692fecdd7e0e867f26f25cdc300dafbf2b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 20 Apr 2008 16:57:21 +0000 Subject: 24852: more combining chars fallout --- Src/Zle/zle_main.c | 2 +- Src/Zle/zle_vi.c | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'Src/Zle') 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; } -- cgit 1.4.1