zsh-workers
 help / color / mirror / code / Atom feed
From: greg@alphatech.com (Greg Klanderman)
To: zsh-workers@math.gatech.edu
Subject: bug in 3.1.4 completion
Date: Tue, 3 Nov 1998 12:28:43 -0500 (EST)	[thread overview]
Message-ID: <13887.15691.65156.627407@catbus.alphatech.com> (raw)


Hi,

I have found a minor bug in zsh 3.1.4 completion related to the
automagic removal of completed slashes.  If I invoke zsh -f, 

% mkdir test
% cd test
% mkdir foo
% mkdir foo/bar foo/barbaz

% ls f               ; now type TAB
  -> foo/            ; now type TAB
  -> foo/bar         ; now type SPACE
  -> foo/ba          ; notice the "r" got removed.

This only seems to happen if you complete "foo" then
immediately hit TAB again.  If you type part of "bar" and
then TAB it functions correctly.

While I'm at it I have a few other nits about the completion system
(which on the whole I think is excellent).

First, another somewhat inconvenient behavior related to slash removal
(again zsh -f, and with the same directories created above):

% ls fo bar      ; position the cursor on the space after the "o", hit TAB
  -> foo/ bar    ; now, the cursor is still on the space after the "/".
                 ; hit Control-d to delete the space 
  -> foo/bar     ; with cursor on "b".  now Control-e (end-of-line) and
  -> foobar      ; the "/" gets removed.  ugh.

                
Another behavior that's not quite right IMHO is completeinword:

% setopt noalwaystoend completeinword
% ls fo/bar         ; position cursor on "/", hit TAB
  -> foo/bar/       ; hit TAB again
  -> foo/bar//      ; hit TAB again
  -> foo/bar///     ; etc, never listing possible completions

Even if I move past the "/", or even "b" it never jumps to the end of
"bar".  Setting alwaystoend helps, though it is still very picky about
the stuff on both sides matching, which often makes the feature
useless.  I have modified emacs to do what I believe is the right
thing:

   * look for completions using both text on left and right.
     if there are none, look only for completions from the left.  this 
     way having some garbage on the right doesn't hose you, it just
     gets pushed right (it may match later, after more completing).
   * now, insert the completed text, placing cursor at the end of the
     insertion.
   * remove the longest substring to the right (with start anchored at
     the cursor) which matches a substring to the left (with end
     anchored at the cursor).  there may be none.

How hard would it be to add this to zsh?

While I'm on little nits, it would be nice if the FIGNORE variable
were not used when listing completions:

% FIGNORE='.o'
% touch foo.o foo.c
% ls fo      ; type Control-d to list completions, you only see "foo.c"

One last feature that'd be nice is automatic case conversion.  When
completing, if no completions are found, try again for a case
insensitive completion.  Would this be easy to add?


Please CC me in replies, I am not on the list.

many thanks,
Greg



             reply	other threads:[~1998-11-03 17:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-03 17:28 Greg Klanderman [this message]
1998-11-04  9:04 Sven Wischnowsky
1998-11-04 17:31 ` Bart Schaefer
1998-11-04 17:59 ` Bart Schaefer
1998-11-05  0:32 ` Greg Klanderman
1998-11-05 16:12 ` Greg Klanderman
1998-11-05  8:02 Sven Wischnowsky
1998-11-05 10:47 Sven Wischnowsky
1998-11-05 16:34 Sven Wischnowsky

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=13887.15691.65156.627407@catbus.alphatech.com \
    --to=greg@alphatech.com \
    --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).