Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Strange or interesting zcompile behavior, for in-loop func defs
- X-seq: zsh-workers 41435
- From: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Strange or interesting zcompile behavior, for in-loop func defs
- Date: Mon, 17 Jul 2017 15:50:58 +0200
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hello,
I've added debugging message in execfuncdef():
if (state->prog->dump || !names) {
if (!names) {
...
} else {
fprintf( stderr, "Have dump for: %s, file: %s\n", s, state->prog->dump->filename);
fflush( stderr );
prog->flags = EF_MAP;
incrdumpcount(state->prog->dump);
It outputs:
Have dump for: _zsh_highlight_widget_zle-isearch-update, file: /Users/sgniazdowski/.zplugin/lexicon.zwc
The point is: this function is declared in a loop:
if [[ $cur_widget == zle-* ]] && [[ -z $widgets[$cur_widget] ]]; then
_zsh_highlight_widget_${cur_widget}() { :; _zsh_highlight }
I do zcompile lexicon.zwc ~/.zplugin/lexicon/*, the directory contains function with the loop. Zcompile apparently picks up above function definition. But from where it gets ${cur_widget}? This is a dynamic data, established at runtime.
The loop:
https://github.com/zdharma/fast-syntax-highlighting/blob/07a76cd38123cac2e76aca35c0258d62b18ab490/fast-syntax-highlighting.plugin.zsh#L203-L240
--
Sebastian Gniazdowski
psprint /at/ zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author