zsh-workers
 help / color / mirror / code / Atom feed
From: Pika Mao <leomaoyw@gmail.com>
To: zsh-workers@zsh.org
Subject: `reset-prompt` multiple times cause multiline PROMPT redraw in the wrong place
Date: Fri, 01 Dec 2017 10:04:30 +0000	[thread overview]
Message-ID: <CAGAiaBEqS--hHT862J13mnq6by_+pt9iB__GwCNi9YBTBc1-bQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

Hello,

If I add a vim mode indicator to a multiline PROMPT, then the sequence
`^[i` (alt-i) will cause the prompt redraw in the wrong place.

The problem seems to be that `reset-prompt` is called multiple times in one
execution cycle.

Following is a minimal .zshrc:

```
zle-keymap-select() {
  zle .reset-prompt
}
zle -N zle-keymap-select

zle-line-init() {
  zle .reset-prompt
}
zle -N zle-line-init

bindkey -v

setopt promptpercent promptsubst
autoload -U promptinit
promptinit
PROMPT='%~$prompt_newline $KEYMAP >> '
```

Leo

             reply	other threads:[~2017-12-01 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 10:04 Pika Mao [this message]
2017-12-01 10: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=CAGAiaBEqS--hHT862J13mnq6by_+pt9iB__GwCNi9YBTBc1-bQ@mail.gmail.com \
    --to=leomaoyw@gmail.com \
    --cc=zsh-workers@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).