Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zle edit-command-line and send-break



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




Messages sorted by: Reverse Date, Date, Thread, Author