From fb5cba5bb73631e54796c5964d6aa81b15a7f1c7 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 13 Nov 2003 15:10:21 +0000 Subject: merge back changes from 4.1 (17567, 17569) --- Src/Zle/zle_tricky.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Src/Zle/zle_tricky.c') diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index c98c8b526..abede4a96 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -150,6 +150,11 @@ mod_export int cfret; /**/ mod_export int comprecursive; +/* != 0 if there are any defined completion widgets. */ + +/**/ +int hascompwidgets; + /* Find out if we have to insert a tab (instead of trying to complete). */ /**/ @@ -554,7 +559,11 @@ docomplete(int lst) if (undoing) setlastline(); - if (!module_loaded("zsh/complete")) + /* From the C-code's point of view, we can only use compctl as a default + * type of completion. Load it if it hasn't been loaded already and + * no completion widgets are defined. */ + + if (!module_loaded("zsh/compctl") && !hascompwidgets) load_module("zsh/compctl"); if (runhookdef(BEFORECOMPLETEHOOK, (void *) &lst)) { -- cgit 1.4.1