Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to avoid infinite recursion in ZLE widgets
- X-seq: zsh-users 26086
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Peter Slížik <peter.slizik@xxxxxxxxx>
- Subject: Re: How to avoid infinite recursion in ZLE widgets
- Date: Sat, 26 Sep 2020 09:27:00 +0000
- Archived-at: <https://zsh.org/users/26086>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-09/20200926092700.01784063%40tarpaulin.shahaf.local2>
- Authentication-results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=fm1; bh=2rqkuQCibYBYaYu4UZXrFPmZCZ 6jJUAU3mjWsmbu70U=; b=cw5CpKbqMbWfHrbVmYG8N7E0KRbtUqYdADqf3G3e6i uBCxU60XRnCAMw1CKEyodXJdsCWp7a4q6S9xNYnB/mjvu9rrVyMMmRcV+UG2DTK4 r0l1aHsG6+yG2VvnPQNNvLi6LEsn0b09LFKKcyX52UAYvSEwNOvJxjhPAc80Ms5y YApB58j1Rui6fY8B5TXcOprRyhUALlT2BGx12W6FJ068CM3vTPPERWKg0oHrzXa4 65MPSv2XX9CzirWL7M5LooOJSQajPCkNmVlOkc9jUFcdzF2TGm1fOZd8FcfQrTd8 mhb3pwUsA4YPwj+JHoruG76XgzN3xivd3UiW7qUG0fgw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=2rqkuQCibYBYaYu4UZXrFPmZCZ6jJUAU3mjWsmbu7 0U=; b=fnGuVni+fB84MgkppS8wWXbC5xafYoTT6PJiryJhYxU6UvsOHDUNpuvKL e+x7IsZbm4Y/VXUhIEulvuqKUgAee4IZCoqnMyP23JfsQRQfQNkXv4/E1SvXuuFv Ax4v5Jj6jZovNlGTzBxgCjWmrocmgZXnmBKKk+jXQnhRDcsIFq6UstL9Kry9XqWd IxZBVb2jcrlPutm4omCJ2cBEbqx7gz0SuBJSDFDGOQ3p1X26jyQ1hj3qWmgjt4k+ RmtO/8rbRetUIuQdG1Crz4vUTDwsgHFr3vYvC+cZeG9ZqFid/FEHWo3/ki7SlIVf Z5489MAwBydtNVtLgboQPie6Oj/Uw==
- In-reply-to: <322971271.67362.1601044983375@mail2.virginmedia.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-users>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-users.zsh.org>
- List-owner: <mailto:zsh-users-request@zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-users>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-users>
- References: <CAC-uhUD6-t3F0ZQuz1A_OWsFOJVj7L0dibNwbnDJurpq4-mZ+Q@mail.gmail.com> <20200923182558.nfokboenuhdypz45@localhost> <CAC-uhUAFiL=LfZZ+PcYRRHgZVTyYJ5rd4r6vFWQTfkHMFNc+gQ@mail.gmail.com> <CAC-uhUC8UY=SJTqdcAZM1Ja3AWAecvy7gcV0RVtKephttQRfRA@mail.gmail.com> <322971271.67362.1601044983375@mail2.virginmedia.com>
- Sender: zsh-users-request@xxxxxxx
Peter Stephenson wrote on Fri, 25 Sep 2020 15:43 +0100:
> > 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.
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 84be010e1..885366c8c 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -502,7 +502,8 @@ ifnzman(noderef(Completion Widgets))\
)
item(tt(-R) [ tt(-c) ] [ var(display-string) ] [ var(string) ... ])(
Redisplay the command line; this is to be called from within a user-defined
-widget to allow changes to become visible. If a var(display-string) is
+widget to allow changes made directly to the terminal (bypassing ZLE) to become
+visible. If a var(display-string) is
given and not empty, this is shown in the status line (immediately
below the line being edited).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author