zsh-users
 help / color / mirror / code / Atom feed
* Bug in vi-mode search
@ 2009-03-12 16:55 Danek Duvall
  2009-03-12 20:38 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Danek Duvall @ 2009-03-12 16:55 UTC (permalink / raw)
  To: zsh-users

Our bug database hasn't synced just yet, so this link doesn't do anything
at the moment, but an internal user filed

    http://bugs.opensolaris.org/view_bug.do?bug_id=6816606

where the bug description says:

    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.

    This could be related to the recent zsh upgrade as searching works as
    expected on prior versions (101, 104).

    In emacs mode searching works as expected.

Builds 101 and 104 had zsh 4.3.4; the build he's filing the bug against has
zsh 4.3.9.  I've confirmed the bug's behavior, but don't have access to
non-Solaris systems on which to try it.  I don't see anything in the
ChangeLog that might have fixed this, but haven't yet tried building from
CVS to see if it exists.

Is this reproducible on other systems?

Thanks,
Danek


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in vi-mode search
  2009-03-12 16:55 Bug in vi-mode search Danek Duvall
@ 2009-03-12 20:38 ` Peter Stephenson
  2009-04-26 22:42   ` Danek Duvall
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2009-03-12 20:38 UTC (permalink / raw)
  To: zsh-users

On Thu, 12 Mar 2009 09:55:30 -0700
Danek Duvall <duvall@comfychair.org> 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@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in vi-mode search
  2009-03-12 20:38 ` Peter Stephenson
@ 2009-04-26 22:42   ` Danek Duvall
  0 siblings, 0 replies; 3+ messages in thread
From: Danek Duvall @ 2009-04-26 22:42 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-users

On Thu, Mar 12, 2009 at 08:38:18PM +0000, Peter Stephenson wrote:

> On Thu, 12 Mar 2009 09:55:30 -0700
> Danek Duvall <duvall@comfychair.org> 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.

Sorry it's taken me so long to confirm, but I can, now.  Thanks for the
fix.

Danek


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-26 22:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12 16:55 Bug in vi-mode search Danek Duvall
2009-03-12 20:38 ` Peter Stephenson
2009-04-26 22:42   ` Danek Duvall

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).