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

Re: smart-insert-last-word bugs

On Oct 15,  5:58pm, Vincent Lefevre wrote:
} ... another one: after I type a command and use completion,
} smart-insert-last-word removes the space between the command and the
} argument.

I think this is the generic problem with user-defined widgets and
autoremoval, to wit, whether to do autoremoval is a property of the
*next* widget executed (*after* the one that did the auto-insertion)
and there's no way to tell zle what the autoremoval property should
be for a user-defined widget.

This can be worked around by arranging that the first thing the user-
defined widget does is execute a built-in widget that thas the desired
autoremoval behavior.  So perhaps a reasonable fix would be to create
a couple of built-in widgets that do nothing *except* autoremoval. E.g.,

       zle remove-preceding-auto-suffix
       zle retain-preceding-auto-suffix

(choose other names as appropriate).

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