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

PATCH: zle-history-line-set hook



This is a good place to be able to do highlighting.

Index: Doc/Zsh/zle.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/zle.yo,v
retrieving revision 1.91
diff -p -u -r1.91 zle.yo
--- Doc/Zsh/zle.yo	18 Feb 2011 22:08:45 -0000	1.91
+++ Doc/Zsh/zle.yo	18 Feb 2011 22:29:04 -0000
@@ -923,6 +923,10 @@ item(tt(zle-line-finish))(
 This is similar to tt(zle-line-init) but is executed every time the
 line editor has finished reading a line of input.
 )
+tindex(zle-history-line-set)
+item(tt(zle-history-line-set))(
+Executed when the history line changes.
+)
 tindex(zle-keymap-select)
 item(tt(zle-keymap-select))(
 Executed every time the keymap changes, i.e. the special parameter
Index: Src/Zle/zle_hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_hist.c,v
retrieving revision 1.67
diff -p -u -r1.67 zle_hist.c
--- Src/Zle/zle_hist.c	12 Dec 2010 22:44:51 -0000	1.67
+++ Src/Zle/zle_hist.c	18 Feb 2011 22:29:04 -0000
@@ -765,6 +765,7 @@ zle_setline(Histent he)
     histline = he->histnum;
 
     setline(GETZLETEXT(he), ZSL_COPY|ZSL_TOEND);
+    zlecallhook("zle-history-line-set", NULL);
     setlastline();
     clearlist = 1;
     if (remetafy)

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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