Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: vi-backward-kill-word
- X-seq: zsh-workers 24865
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: vi-backward-kill-word
- Date: Wed, 23 Apr 2008 09:32:55 +0100
- In-reply-to: <C0AC3775-F880-40DF-BB43-F24321184707@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <A2142905-01C6-4D18-9CE2-EC23B8DE2F03@xxxxxxxxxxxxxxxxx> <20080421182728.3450104d@news01> <C0AC3775-F880-40DF-BB43-F24321184707@xxxxxxxxxxxxxxxxx>
"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