Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug in vi-mode search
- X-seq: zsh-users 13903
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Bug in vi-mode search
- Date: Thu, 12 Mar 2009 20:38:18 +0000
- In-reply-to: <20090312165530.GA1834@xxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20090312165530.GA1834@xxxxxxxxxxxxxxxxxxxxx>
On Thu, 12 Mar 2009 09:55:30 -0700
Danek Duvall <duvall@xxxxxxxxxxxxxx> wrote:
> When using vi keybindings (set -o vi) history search is initiated by
> ESC-/. The searching appears to be broken:
>
> The initial history line returned is correct but subsequent entries (by
> repeatedly pressing '/') returned don't have the search string in them
> and appear to simply be sequential entries from the history file.
Yes, this looks like a simple screwup when changing the code.
I've also noticed I unintentionally removed the "_" that appears where
the next character is to be inserted.
See if this is better.
(Diff against the files in the Git repository Wayne set up while we wait
for CVS to recover, at which point it will be committed.)
--- ../zsh-git/zsh/Src/Zle/zle_hist.c 2009-03-12 20:34:56.000000000 +0000
+++ Src/Zle/zle_hist.c 2009-03-12 20:18:29.000000000 +0000
@@ -1742,7 +1742,7 @@
selectkeymap("main", 1);
while (sptr) {
sbuf[sptr] = '_';
- sbuf[sptr] = '\0';
+ sbuf[sptr+1] = '\0';
zrefresh();
if (!(cmd = getkeycmd()) || cmd == Th(z_sendbreak)) {
ret = 0;
@@ -1760,6 +1760,10 @@
cmd == Th(z_vicmdmode)) {
sbuf[sptr] = ZWC('\0');
visrchstr = ztrdup(sbuf+1);
+ if (!strlen(visrchstr)) {
+ zsfree(visrchstr);
+ visrchstr = ztrdup(vipenultsrchstr);
+ }
ret = 1;
sptr = 0;
} else if(cmd == Th(z_backwarddeletechar) ||
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author