zsh-workers
 help / color / mirror / code / 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

Hello,

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.

-- 
zsugabubus


^ 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

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).