Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: crash when expand-or-complete widget wrapped
- X-seq: zsh-workers 26826
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: crash when expand-or-complete widget wrapped
- Date: Wed, 08 Apr 2009 09:02:53 -0700
- In-reply-to: <20090408044920.GA21100@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20090407035737.GA4200@xxxxxxxxxxxxxxxx> <20090408044920.GA21100@xxxxxxxxxxxxxxxx>
On Apr 8, 12:49am, Dylan Alex Simon wrote:
}
} > > Try the patch below. Doesn't actually find any useful completions,
} > > but at least fixes the infinite-but-for-memory-limits loop.
} >
} > Yes, that's correct, it was just a typo I introduced recently before
} > 4.3.9.
}
} Is there some reason this is not an okay thing to do or that
} completion widgets should be called differently? (I'm working on
} improving predict-on.)
It shouldn't outright crash, but ...
You can't call completion widgets from non-completion widgets, in the
general case. In fact you generally can't call completion widgets
with "zle widget_name", because completion widgets don't share the
normal editor state.
Instead you need to create your wrapper widget as a completion widget
itself, and then call the function that implements the other widget
directly, such as:
widget-wrapper () {
$WIDGET "$@"
}
zle -C widget-wrapper expand-or-complete widget-wrapper
See the implementations of _complete_help or _complete_debug for
examples, note that they set things up and then call _main_complete
directly.
Yes, this means there is no way to "wrap" a built-in completion widget.
I think you can call completion widgets from normal widgets by pushing
keystrokes with "zle -U" and then invoking "zle recursive-edit" but I'm
not entirely sure it will always work.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author