zsh-workers
 help / color / mirror / code / Atom feed
* history-incremental-search-backward string argument regression
@ 2017-12-04 22:50 Harm te Hennepe
  2017-12-09  8:10 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Harm te Hennepe @ 2017-12-04 22:50 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

Hi,

I was trying to let ^r prefill the incremental search minibuffer with the
current buffer contents.

According to the manual:

---
When called from a widget function by the zle command, the incremental
search commands can take a string argument.  This will be treated as a
string of keys, as for arguments  to  the  bindkey  and used as initial
input for the command.  Any characters in the string which are unused by
the incremental search will be silently ignored.  For example,

zle history-incremental-search-backward forceps

search backwards for forceps, leaving the minibuffer containing the string
`forceps'.
---

I've created a widget calling this,  but the minibuffer stayed empty. When
I manually type something into the minibuffer, it does the usual search,
but when I then press ^r again to find the next result, I get an empty
minibuffer again, instead of the next result.

zsh 5.2 (x86_64-ubuntu-linux-gnu) (Ubuntu 17.10 default): broken
zsh 5.4.2-dev-0 (x86_64-unknown-linux-gnu) (newest git on Ubuntu 17.10):
broken
zsh 4.3.11 (x86_64-redhat-linux-gnu) (CentOS 6.4): WORKS

Harm

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

* Re: history-incremental-search-backward string argument regression
  2017-12-04 22:50 history-incremental-search-backward string argument regression Harm te Hennepe
@ 2017-12-09  8:10 ` Bart Schaefer
  2017-12-10 23:46   ` Harm te Hennepe
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2017-12-09  8:10 UTC (permalink / raw)
  To: zsh-workers

On Mon, Dec 4, 2017 at 2:50 PM, Harm te Hennepe <dhtehennepe@gmail.com> wrote:
>
> I was trying to let ^r prefill the incremental search minibuffer with the
> current buffer contents.
>
> I've created a widget calling this,  but the minibuffer stayed empty.

Hmm, this is working for me (zsh-5.4.2-114-g45f3169):

% setopt histnofunctions
% revsrch() { zle history-incremental-search-backward waggle }
% zle -N revsrch
% bindkey '^R' revsrch
%
failing bck-i-search: waggle_


> I manually type something into the minibuffer, it does the usual search,
> but when I then press ^r again to find the next result, I get an empty
> minibuffer again, instead of the next result.

There are a few reasons why repeating the binding might not repeat the
search when a user-defined widget is involved.  Perhaps post your
function?


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

* Re: history-incremental-search-backward string argument regression
  2017-12-09  8:10 ` Bart Schaefer
@ 2017-12-10 23:46   ` Harm te Hennepe
  0 siblings, 0 replies; 3+ messages in thread
From: Harm te Hennepe @ 2017-12-10 23:46 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

Thanks for your check. Somehow I completely forgot to run the code with
'zsh -f' :-( Seems that some other code in my .zshrc is interfering. I'll
figure out what causes this, and let you know if I still believe it
shouldn't happen.

Harm

On Sat, 9 Dec 2017 at 09:10 Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Mon, Dec 4, 2017 at 2:50 PM, Harm te Hennepe <dhtehennepe@gmail.com>
> wrote:
> >
> > I was trying to let ^r prefill the incremental search minibuffer with the
> > current buffer contents.
> >
> > I've created a widget calling this,  but the minibuffer stayed empty.
>
> Hmm, this is working for me (zsh-5.4.2-114-g45f3169):
>
> % setopt histnofunctions
> % revsrch() { zle history-incremental-search-backward waggle }
> % zle -N revsrch
> % bindkey '^R' revsrch
> %
> failing bck-i-search: waggle_
>
>
> > I manually type something into the minibuffer, it does the usual search,
> > but when I then press ^r again to find the next result, I get an empty
> > minibuffer again, instead of the next result.
>
> There are a few reasons why repeating the binding might not repeat the
> search when a user-defined widget is involved.  Perhaps post your
> function?
>

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

end of thread, other threads:[~2017-12-10 23:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-04 22:50 history-incremental-search-backward string argument regression Harm te Hennepe
2017-12-09  8:10 ` Bart Schaefer
2017-12-10 23:46   ` Harm te Hennepe

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).