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

[PATCH 0/2] Custom init and finish hooks with vared

So, I wanted to write a function that helps me write commit messages with
git from the command line, roughly like this:

#+begin_src shell-script
local msg name email
name=$(git config --get user.name)
email=$(git config --get user.email)

Signed-off-by: $name <$email>"

vared -p $' - type your commit message -\n' msg
printf '%s\n' "$msg" | git commit -F-
#+begin_src shell-script

Of course, I wanted to have the cursor at the very beginning of the
vared buffer after vared started up. I could have done it by using
$CONTEXT and some other state-handling variables all within
`zle-line-init', but I think being able to do it the way the second
patch of this series implements is way more elegant.

Documentation update coming up, unless someone screams "this has no
chance of making it into the core!"... ;)

Regards, Frank

Frank Terbeck (2):
  zle: Make sure state changes are refreshed after init hook
  Let vared define custom init and finish hooks

 Src/Zle/zle_main.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)


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