help / Atom feed
* A more advanced tracking of plugins in Zplugin
@ 2019-08-09 11:59 Sebastian Gniazdowski
  0 siblings, 0 replies; 1+ messages in thread
From: Sebastian Gniazdowski @ 2019-08-09 11:59 UTC (permalink / raw)
  To: Zsh Users

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

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] 1+ messages in thread

only message in thread, back to index

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


Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/ public-inbox