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

Re: [BUG] insert-last-word gets stuck at comments



On Mon, Jul 26, 2021 at 12:07 AM Frederick Eaton <frederik@xxxxxxx> wrote:
>
> This may be a somewhat minor bug, but I think that when
> interactive_comments is set, the 'insert-last-word' widget gets stuck
> on lines that are fully commented:

I'm able to reproduce this.  A fully-commented line has an event
number but contains no words; e.g., it's also an "error" to attempt to
refer to event number 3 e.g. with !3 in the example:

>      $ zsh -f -i
>      % setopt interactive_comments
>      % echo hi #comment
>      hi
>      % # blah blah
>      % echo bye #comment
>      bye
>      % echo foo
>      foo
>      % echo <Esc>.<Esc>.<Esc>.

At this point:

% !3
zsh: no such word in event

Even though !2 and !4 work as expected.  So insert-last-word gets as
far as event 3 and then gets the no-such-word error, which interrupts
it.

A workaround is to enable smart-insert-last-word.




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