zsh-workers
 help / color / mirror / code / Atom feed
From: Alexandre Duret-Lutz <duret_g@epita.fr>
To: zsh-workers@math.gatech.edu
Subject: PATH: EQUAL completion fixe
Date: 18 Jan 2000 11:37:57 +0100	[thread overview]
Message-ID: <mvbaem31x8a.fsf@phobos.lrde.epita.fr> (raw)


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


                 reply	other threads:[~2000-01-18 10:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mvbaem31x8a.fsf@phobos.lrde.epita.fr \
    --to=duret_g@epita.fr \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).