zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] Line number in prompt after `zle reset-prompt'
Date: Sun, 1 Nov 2015 16:18:13 +0100	[thread overview]
Message-ID: <CAKc7PVAREgNTYv8KD6Oh2aA6kUa+fa2cvHUUCcidKvufT2qK3Q@mail.gmail.com> (raw)
In-Reply-To: <151031132331.ZM21501@torch.brasslantern.com>

I would say it's not a bug. I found it possible to replace
"reset-prompt" with "redisplay" which doesn't re-expand prompt.
However, there is one interesting thing:

PROMPT=" %i # "
a() { zle redisplay }
zle -N a
b() { zle redisplay; zle -M "test" }
zle -N b
c() { zle -M "test" }
zle -N c
bindkey "^E" a
bindkey "^R" b
bindkey "^T" c

"a" and "c" will not reexpand prompt, while "b" will, apparently with no reason

Best regards,
Sebastian Gniazdowski


On 31 October 2015 at 21:23, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Oct 31,  7:42pm, Sebastian Gniazdowski wrote:
> }
> } PROMPT="%i # "
> } a() { zle reset-prompt }
> } zle -N a
> } bindkey "^E" a
> }
> } and press Ctrl-E. Line number will change
>
> Not sure this is a bug:
>
> %N
>      The name of the script, sourced file, or shell function that zsh is
>      currently executing, whichever was started most recently.
>
> %i
>      The line number currently being executed in the script, sourced
>      file, or shell function given by %N.
>
> If you use:
>
>     PROMPT="%N %i # "
>
> and then press ^E, you will see
>
>     a 0 #
>
> which is correct, the line number in the function "a" is 0.


  reply	other threads:[~2015-11-01 15:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-31 18:42 Sebastian Gniazdowski
2015-10-31 20:23 ` Bart Schaefer
2015-11-01 15:18   ` Sebastian Gniazdowski [this message]
2015-11-01 18:59     ` Bart Schaefer

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=CAKc7PVAREgNTYv8KD6Oh2aA6kUa+fa2cvHUUCcidKvufT2qK3Q@mail.gmail.com \
    --to=sgniazdowski@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).