Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
A more advanced tracking of plugins in Zplugin
- X-seq: zsh-users 24140
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: A more advanced tracking of plugins in Zplugin
- Date: Fri, 9 Aug 2019 13:59:41 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=EGyxh4hqstUtNAN7U7YNGbtzEDCmFnk4eSvAdHPog78=; b=md0RnlezBc/ryKFG8u4Nh412V7gvs5CIGxQtYCrlEbNagt2DHkOiK23tkOMPzMiGuQ MJWIIpSgeFpE9VhIXcYdh0a1l5f+eLXrPYQaLaQQPeWqBYLabNDlTVUskpVALK13AuuQ EYbDx8iISN0PrAqXZ3nFYCeWWSLIX+Qpd6T5A5Yp+A1tZWzLQxuxNgezKqoqD03PENN/ aqLJnPZUKnd6shGAI8Hx0e99KbFG5TS02Dn9s7UAEUl+p0vz3GmI19AI8JHJLzaiCzGB 5JuX1tmpX7i28biPyJPVJDJcTwoL0mfa8xRF8xIKiXrwWobe74EVpTkMZbrkOUuJhsjK P2fw==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author