Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: vi-backward-kill-word



"Jun T." wrote:
> In vireplacechars(), line 545 (zle_vi.c),
>              foredel(n - newchars, CUT_RAW);
> 
> this will remove the base character "e" at zlecs, shift the
> combining character, and move zlecs to the next base char "o".

Yes, that needs to use shiftchars(), as I've already done in overwrite
mode.

Index: Src/Zle/zle_vi.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_vi.c,v
retrieving revision 1.20
diff -u -r1.20 zle_vi.c
--- Src/Zle/zle_vi.c	21 Apr 2008 17:30:36 -0000	1.20
+++ Src/Zle/zle_vi.c	23 Apr 2008 08:31:48 -0000
@@ -540,9 +540,11 @@
 	 * Make sure we delete displayed characters, including
 	 * attach combining characters. n includes this as a raw
 	 * buffer offset.
+	 * Use shiftchars so as not to adjust the cursor position;
+	 * we are overwriting anything that remains directly.
 	 */
 	if (n > newchars)
-	    foredel(n - newchars, CUT_RAW);
+	    shiftchars(zlecs, n - newchars);
 	else if (n < newchars)
 	    spaceinline(newchars - n);
 	while (newchars--)

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author