about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-11-13 15:10:21 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-11-13 15:10:21 +0000
commitfb5cba5bb73631e54796c5964d6aa81b15a7f1c7 (patch)
tree0cff9c26ba929533732792711ad8a784eae52b37 /Src
parentba2482aad62406540cde7d398032b5a7335a9a5a (diff)
downloadzsh-fb5cba5bb73631e54796c5964d6aa81b15a7f1c7.tar.gz
zsh-fb5cba5bb73631e54796c5964d6aa81b15a7f1c7.tar.xz
zsh-fb5cba5bb73631e54796c5964d6aa81b15a7f1c7.zip
merge back changes from 4.1 (17567, 17569)
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_main.c1
-rw-r--r--Src/Zle/zle_thingy.c2
-rw-r--r--Src/Zle/zle_tricky.c11
3 files changed, 13 insertions, 1 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index c5225ccdb..cb1854e9b 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1138,6 +1138,7 @@ setup_(Module m)
     varedarg = NULL;
 
     incompfunc = incompctlfunc = hascompmod = 0;
+    hascompwidgets = 0;
 
     clwords = (char **) zshcalloc((clwsize = 16) * sizeof(char *));
 
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index f40bd18b8..142fc263d 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -588,6 +588,8 @@ bin_zle_complete(char *name, char **args, char *ops, char func)
 	zwarnnam(name, "widget name `%s' is protected", args[0], 0);
 	return 1;
     }
+    hascompwidgets++;
+
     return 0;
 }
 
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)) {