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 10:52 PM Frederick Eaton <frederik@xxxxxxx> wrote:
>
> I've read the documentation for insert-last-word and
> smart-insert-last-word and I can't figure out how they are different.
>
> So they are the same when interactive_comments is not set? However,
> according to my experiments it seems that insert-last-word also
> ignores comments when interactive_comments is set, so I am not able to
> understand the difference.

I think what's happened is that a (now very old) change to the way the
history mechanism stores/fetches words, had an unexpected side-effect
on insert-last-word.

Where we've ended up is that insert-last-word can never "see"
comments, but smart-insert-last-word is able to see them if the
setting of interactive_comments changes from on to off between the
time the comment got entered into the history and the time
smart-insert-last-word is run.  Which of course almost never occurs.

There's code in the insertlastword function that's (according to the
comment) supposed to stop us getting stuck, but apparently in the case
where the line is entirely empty that isn't working.  It may be
possible to fix it.




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