Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATH: EQUAL completion fixe



There was a bug in _arguments completion for `=' options :

% a2ps --prologue<TAB>
prologue
bold     bw       color    diff     gray     gray2    matrix 
% a2ps --prologue<TAB>
% a2ps --prologuebold

Since `--prologue' is recognized as an option name by ca_get_opt(), 
no `=' is added, and match are appended right after the option.

The patch below prevent EQUAL options from beeing recognized unless
there is the `=' or a space before the next word.

% a2ps --prologue<TAB>

should complete to

% a2ps --prologue=

Index: Src/Zle/computil.c
--- Src/Zle/computil.c Wed, 05 Jan 2000 14:51:45 +0100 Alexandre
+++ Src/Zle/computil.c Tue, 18 Jan 2000 11:29:23 +0100 Alexandre
@@ -1109,7 +1109,10 @@
 
 	/* See if it's an option. */
 
-	if (state.opt == 2 && (state.curopt = ca_get_opt(d, line, 0, &pe))) {
+	if (state.opt == 2 && (state.curopt = ca_get_opt(d, line, 0, &pe)) &&
+	    (state.curopt->type != CAO_EQUAL || 
+	     compwords[cur] || pe[-1] == '=')) {
+
 	    ddef = state.def = state.curopt->args;
 	    doff = pe - line;
 	    state.optbeg = state.argbeg = state.inopt = cur;


-- 
Alexandre Duret-Lutz



Messages sorted by: Reverse Date, Date, Thread, Author