zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: zle .redisplay sometimes eating up a line
Date: Mon, 15 Jul 2019 20:31:08 +0200	[thread overview]
Message-ID: <CAKc7PVAaAVFROyM1k6w2x8HsBDcqYiqUk=1s_knJ0tAUOMpZFQ@mail.gmail.com> (raw)
In-Reply-To: <CAN=4vMp+e9bjzFN5Um8gL_z_mg61A0b1oKTXn3xqex8Rff2vJA@mail.gmail.com>

On Mon, 15 Jul 2019 at 11:18, Roman Perepelitsa
<roman.perepelitsa@gmail.com> wrote:
> What's your $ZSH_PATCHLEVEL?

zsh-5.7.1-101-g09385d3

> Could you post self-contained instructions for reproducing this?
> Something like this:
>
> 1. Start `zsh -df`.
> 2. Copy-paste this code. The code should not require Internet access.
> 3. Press and hold Ctrl+T.
>
> Roman.

The instructions will be not fully self-contained, as the issue
reveals itself with 3 plugins being loaded:

1. git clone https://github.com/geometry-zsh/geometry
2. git clone https://github.com/zsh-users/zsh-autosuggestions autos
3. git clone https://github.com/zsh-users/zsh-syntax-highlighting zsyh
4. zsh -dfi
5. source geometry/geometry.plugin.zsh
6. source autos/zsh-autosuggestions.zsh
7. source zsyh/zsh-syntax-highlighting.zsh
8. Paste the code (http://sprunge.us/SAkQxz):
deploy-code() {
[[ "$1" = <-> && ${#} -eq 1 ]] && {
    local alltext text IFS=$'\n' nl=$'\n'
     repeat 25; do read -r -u"$1" text; alltext+="${text:+$text$nl}"; done
    zle -F "$1"; exec {1}<&-
    eval "$alltext"
    return 0
}
local THEFD
exec {THEFD} < <(
    # The expansion is: if there is @sleep: pfx, then use what is after
    # it, otherwise substitute 0
    LANG=C sleep $(( 0.005 + ${${${(M)1#@sleep:}:+${1#@sleep:}}:-0} ))
    print -r -- ${1:#(@code|@sleep:*)} "${@[2,-1]}"
)
zle -N deploy-code
zle -w -F "$THEFD" deploy-code
}
deploy-code-widget() { BUFFER+='B'; deploy-code @sleep:0.5
"BUFFER+='a'; zle .redisplay;"; }
zle -N deploy-code-widget
bindkey "^T" deploy-code-widget

9. Press and long hold Ctrl-T

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

  reply	other threads:[~2019-07-15 18:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15  3:02 Sebastian Gniazdowski
2019-07-15  9:18 ` Roman Perepelitsa
2019-07-15 18:31   ` Sebastian Gniazdowski [this message]
2019-07-15 18:43     ` Roman Perepelitsa
2019-07-15 18:53       ` Sebastian Gniazdowski
2019-07-16 22:12         ` Sebastian Gniazdowski
2019-07-29 19:13 ` Sebastian Gniazdowski
2019-07-29 21:46   ` Mikael Magnusson
2019-07-29 22:16     ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKc7PVAaAVFROyM1k6w2x8HsBDcqYiqUk=1s_knJ0tAUOMpZFQ@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).