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 26087
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: How to avoid infinite recursion in ZLE widgets
- Date: Sat, 26 Sep 2020 11:40:26 +0200
- Archived-at: <https://zsh.org/users/26087>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-09/CAN%3D4vMpUS4oSczhUi6yMhTNU%2Bn8%3D1DxKBAWvfj7jCoovLgO8Bw%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-io1-f46.google.com) smtp.remote-ip=209.85.166.46; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Cc: Peter Slížik <peter.slizik@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fhPstIbjfPbsZA0xmnPbjQevb95P8CTxcXZNOJk2YRI=; b=cAwQLW62TAgVS96WiTjGsjrHcDEXrZqSjJiAmey55LhnycNJ/6fSgsp/i9DIrHVRpo yMsjwVHuijNxrupEFRHPcGybK+taSMXKGcNbNwy0dB+dRi635SFxQY9hwNGpTPLd5fPw CCoc+EAoESQoZ+SpaH6ZOIadGpcnmUw9lEIBX9TFb/61ids9+ml0QtNyMXVPgUiHyuR+ UUD9zWi+viBtU5yUBsVznxWKygOk0nnsrmMrWNUJiswW5pNCXPuoG1ukw6zOvdepETw0 EIzVRK9EzvkjpLRiX31LxzHQfok9UbjCbxXVG98pZImTHGLBeq3sCsvjgGxnuyWZ/zhu lI/Q==
- In-reply-to: <20200926092700.01784063@tarpaulin.shahaf.local2>
- 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> <20200926092700.01784063@tarpaulin.shahaf.local2>
- Sender: zsh-users-request@xxxxxxx
On Sat, Sep 26, 2020 at 11:27 AM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> 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).
I think the original documentation was correct. Consider this snippet:
function a() {
BUFFER+='foo'
zle -R
sleep 1
BUFFER+='bar'
}
zle -N a
bindkey '^A' a
function b() {
BUFFER+='foo'
sleep 1
BUFFER+='bar'
}
zle -N b
bindkey '^B' b
If you press Ctrl+A, "foo" will appear immediately, followed by "bar"
after one second. However, if you press Ctrl+B, "foobar" will appear
after one second. The only difference between the two widgets is that
the first invokes `zle -R` after appending "foo" to BUFFER but the
second doesn't.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author