zsh-users
 help / color / mirror / code / Atom feed
* A more advanced tracking of plugins in Zplugin
@ 2019-08-09 11:59 Sebastian Gniazdowski
  0 siblings, 0 replies; only message in thread
From: Sebastian Gniazdowski @ 2019-08-09 11:59 UTC (permalink / raw)
  To: Zsh Users

Hello,
out of the discussion with romkatv I've updated the tracking and
unloading of Zle widgets in Zplugin. The stacking of Zle widgets now
gets resolved. So for example, if 1st plugin will do:

    zle -N -- orig-vi-backward-char ${widgets[vi-backward-char]#user:}
    eval "_wrap_vi-backward-char() {
        …do something additional here
        zle orig-vi-backward-char
    }"
    zle -N -- vi-backward-char _wrap-vi-backward-char

and then a second plugin does the same, then unloading of the first
plugin will correctly redirect the zle orig-vi-backward-char of the
second plugin above the seconth plugin to the preceding
vi-backward-char widget.

Side for that, there's a new ice-mod wrap-track'' which takes a list
of names of functions that should  be tracked *once*. In other words,
it wraps the functions with a preceding and following code that
enables and disables the tracking, and then unwraps the function after
the first call. You can use this to extend the tracking beyond the
moment of loading of a plugin, for example prompts often postpone
their initialization to a precmd hook, which can be tracked with the
wrap-track''.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

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

only message in thread, other threads:[~2019-08-09 12:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 11:59 A more advanced tracking of plugins in Zplugin Sebastian Gniazdowski

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