Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: history-incremental-search-backward and personnal zle widget

On 29/12/2007, antho.charles@xxxxxxxxx <antho.charles@xxxxxxxxx> wrote:
> Hi,
> I find this widget from a zshrc I can't remember and I bind it to the dot key:
> # just type 'cd ...' to get 'cd ../..'
> rationalise-dot() {
> if [[ $LBUFFER = *.. ]]; then   LBUFFER+=/..
> else
>   LBUFFER+=. fi
> }
> zle -N rationalise-dot
> bindkey . rationalise-dot
> but when I type a dot in a history-incremental-search-backward ( ^R ), it stops the
> search and insert a dot in the line instead of inserting a dot in the
> searched string. I found something useful in zshzle manpage:
> "A restricted set of editing functions is available in the mini-buffer.  An interrupt
> signal, as defined by the stty setting, will stop the search and go
> back to the original line.  An undefined key will have the same
> effect."
> My question is: is there a way to keep my binded widget and use it
> with history-incremental-search-backward?

I found that too, and encountered the same problem. My limited
investigations led me to believe you would have to hack around in the
C code a fair bit to fix this.

Mikael Magnusson

Messages sorted by: Reverse Date, Date, Thread, Author