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

Re: How to avoid infinite recursion in ZLE widgets



> On 25 September 2020 at 15:19 Peter Slížik <peter.slizik@xxxxxxxxx> wrote:
> By the way, the documentation says that zle -R should be called after
> changing the command line from within a ZLE widget.
>
> However, when playing with LBUFFER and RBUFFER I realized that zle -R is
> not needed and the changes are visible immediately.
> 
> Why is it so?

You only need to call zle -R either if you are passing it an argument
to show, or if you are bypassing the editor interface somehow so it
doesn't know the display has changed.  If you use any of the special
variables or a zle command to update the command line then ZLE's
internals are all consistent and you don't need any special action.

pws




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