zsh-workers
 help / color / mirror / code / Atom feed
From: Felix Rosencrantz <f_rosencrantz@yahoo.com>
To: zsh-workers <zsh-workers@sunsite.auc.dk>
Subject: Bug w/matching control + feature request
Date: Sat, 30 Dec 2000 14:58:58 -0800 (PST)	[thread overview]
Message-ID: <20001230225858.15058.qmail@web1105.mail.yahoo.com> (raw)

I'm seeing a problem with matching control and cursor placement.  I suspect
the problem might be related to too many match points...

Here's the case:

zsh@ zsh -f
host% echo $ZSH_VERSION
3.1.9-dev-8
host% autoload -U compinit ; compinit -D ; compdef _tst tst
host% _tst () {
function> compadd -M 'r:|[.,_-]=** r:[^0-9]||[0-9]=**' glibc-2.1.94-3.i386.rpm
glibc-devel-2.1.94-3.i386.rpm glibc-profile-2.1.94-3.i386.rpm
function> }
host% tst glibc-2.1<TAB>
results in: 
host% tst glibc-2[.]1.94-3.i386.rpm

With the cursor sitting on the dot after the 2, rather than before the 2,
which seems like the place it would end up.


Hmm...  Since the matching specs and cursor positioning came up again,
it got me thinking about a feature request I've wanted.   There are times
when matching places the cursor at the undesired spot for finishing the
completion of the word I'm completing.  The matching code has an idea of
where several other reasonable cursor positions are (see the code
at  zsh/Src/Zle/compresult.c:415, which picks from several possible
cursor locations as hot spots, there are probably a few more.) 

It seems like there would need to be a global array that is accessible to the
completion functions, that would hold valid hot spots in the current word.
It would then be possible to write a widget that would cycle the cursor
between these spots.

For the example above:
    glibc-2.1.94-3.i386.rpm
The valid spots would be just before the 2, and the end of the word, since
the word matches one of the choices.

-FR.

__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/


             reply	other threads:[~2000-12-30 22:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-30 22:58 Felix Rosencrantz [this message]
2001-01-09  8:02 Sven Wischnowsky
2001-01-11  9:56 Sven Wischnowsky
2001-01-12  4:47 Felix Rosencrantz
2001-01-15  5:04 Felix Rosencrantz

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=20001230225858.15058.qmail@web1105.mail.yahoo.com \
    --to=f_rosencrantz@yahoo.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).