zsh-workers
 help / color / mirror / code / Atom feed
* PATH: EQUAL completion fixe
@ 2000-01-18 10:37 Alexandre Duret-Lutz
  0 siblings, 0 replies; only message in thread
From: Alexandre Duret-Lutz @ 2000-01-18 10:37 UTC (permalink / raw)
  To: zsh-workers


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-01-18 10:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-18 10:37 PATH: EQUAL completion fixe Alexandre Duret-Lutz

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).