diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2008-04-24 10:18:59 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2008-04-24 10:18:59 +0000 |
commit | cca52d8edb5c5f91ca9ba51ce7c90f33e221b67a (patch) | |
tree | 56cd4fd9fc18c73ed007f2adc443b59e8ee033d0 /Src/Zle/zle_utils.c | |
parent | 62b7e68a63650922463c52b108cbac397909312e (diff) | |
download | zsh-cca52d8edb5c5f91ca9ba51ce7c90f33e221b67a.tar.gz zsh-cca52d8edb5c5f91ca9ba51ce7c90f33e221b67a.tar.xz zsh-cca52d8edb5c5f91ca9ba51ce7c90f33e221b67a.zip |
unposted: Jun T.: fix backkill() calculation of charaters to kill
Diffstat (limited to 'Src/Zle/zle_utils.c')
-rw-r--r-- | Src/Zle/zle_utils.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index acc6c3717..4aca1958d 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -589,20 +589,18 @@ cuttext(ZLE_STRING_T line, int ct, int flags) mod_export void backkill(int ct, int flags) { - int i; - UNMETACHECK(); if (flags & CUT_RAW) { - i = (zlecs -= ct); + zlecs -= ct; } else { - int n = ct; - while (n--) + int origcs = zlecs; + while (ct--) DECCS(); - i = zlecs; + ct = origcs - zlecs; } - cut(i, ct, flags); - shiftchars(i, ct); + cut(zlecs, ct, flags); + shiftchars(zlecs, ct); CCRIGHT(); } |