help / color / mirror / Atom feed
* zle edit-command-line and send-break
@ 2020-08-05  9:04 zsugabubus
  0 siblings, 0 replies; only message in thread
From: zsugabubus @ 2020-08-05  9:04 UTC (permalink / raw)
  To: zsh-workers


I would like to apply some transformation to $BUFFER before and after
editing it with `zle edit-command-line`.

Modifying $BUFFER before editing is trivial, however the after part is a
bit tricky since edit-command-line calls send-break. Currently I use the
following workaround to being able to execute custom code:

  function send-break() {
    zle -D send-break
    unfunction send-break
    read -z BUFFER
    # ...do something with BUFFER...
    zle redisplay
  zle -N send-break

  zle edit-command-line

It works fine, so I’m wondering why `zle send-break` is used inside
edit-command-line and whether `zle redisplay` could be used instead.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-05  9:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05  9:04 zle edit-command-line and send-break zsugabubus


This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:

code repositories for the project(s) associated with this inbox:


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git