From 2bdcaa9a559fc635a08ac73ccd418eafc049d712 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 23 Sep 1999 13:03:26 +0000 Subject: zsh-workers/8010 --- Doc/Zsh/mod_deltochar.yo | 2 +- Src/Zle/deltochar.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/Zsh/mod_deltochar.yo b/Doc/Zsh/mod_deltochar.yo index 4c3cf58e6..d90a6fc47 100644 --- a/Doc/Zsh/mod_deltochar.yo +++ b/Doc/Zsh/mod_deltochar.yo @@ -6,7 +6,7 @@ startitem() tindex(delete-to-char) item(tt(delete-to-char))( Read a character from the keyboard, and -delete from the cursor position up to and including the next +delete from the cursor position up to but not including the next (or, with repeat count var(n), the var(n)th) instance of that character. ) enditem() diff --git a/Src/Zle/deltochar.c b/Src/Zle/deltochar.c index f0df33f95..d6a579d5c 100644 --- a/Src/Zle/deltochar.c +++ b/Src/Zle/deltochar.c @@ -43,7 +43,8 @@ deltochar(char **args) while (dest != ll && line[dest] != c) dest++; if (dest != ll) { - dest++; + if (n > 0) + dest++; if (!n) { forekill(dest - cs, 0); ok++; @@ -59,7 +60,7 @@ deltochar(char **args) dest--; if (line[dest] == c) { if (!n) { - backkill(cs - dest, 1); + backkill(cs - dest - 1, 1); ok++; } if (dest) -- cgit 1.4.1