zsh-users
 help / color / mirror / code / Atom feed
* widget special PREFIX variable and cursor position with complete_in_word
@ 2014-02-12 21:02 Yuri D'Elia
  2014-02-13  5:47 ` Bart Schaefer
  0 siblings, 1 reply; 25+ messages in thread
From: Yuri D'Elia @ 2014-02-12 21:02 UTC (permalink / raw)
  To: zsh-users

I was writing a zstyle widget, and wanted to use the variable PREFIX to
have the first part of the string before the cursor.

>From the docs:

      PREFIX Initially  this will be set to the part of the current word
from the beginning of the word
              up to the position of the cursor; it may be altered  to
give  a  common  prefix  for  all
              matches.

Without complete_in_word it works fine, PREFIX contains the word up to
the cursor indeed. However, with complete_in_word, the following:

$ ls //x<TAB>
dev/ etc/ lib/ sbin/

moves the cursor to the first slash (/):

$ ls //x
      ^
dev/ etc/ lib/ sbin/

In this case, PREFIX contains //x, and not '/' as I would expect.
Fine with that as long as I can know where the cursor is, but I was
looking into the $compstate hash and found nothing. I was hoping for
some offset.

Any help?


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2014-02-26 15:24 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 21:02 widget special PREFIX variable and cursor position with complete_in_word Yuri D'Elia
2014-02-13  5:47 ` Bart Schaefer
2014-02-13 13:38   ` Yuri D'Elia
2014-02-13 17:25     ` Bart Schaefer
2014-02-13 18:12       ` Yuri D'Elia
2014-02-14  6:34         ` Bart Schaefer
2014-02-14 11:56           ` Oliver Kiddle
2014-02-14 12:56             ` Yuri D'Elia
2014-02-14 14:39               ` Oliver Kiddle
2014-02-14 15:38                 ` Yuri D'Elia
2014-02-14 21:36                   ` Oliver Kiddle
2014-02-17 11:10                     ` Yuri D'Elia
2014-02-17 13:28                       ` Yuri D'Elia
2014-02-17 16:50                       ` Oliver Kiddle
2014-02-17 17:54                         ` Yuri D'Elia
2014-02-18 15:23                           ` Oliver Kiddle
2014-02-18 16:07                             ` Yuri D'Elia
2014-02-18 18:07                               ` Oliver Kiddle
2014-02-18 19:45                                 ` Yuri D'Elia
2014-02-25 14:07                                   ` Jesper Nygårds
2014-02-25 14:33                                     ` Yuri D'Elia
2014-02-25 20:41                                   ` Oliver Kiddle
2014-02-26  8:15                                     ` Yuri D'Elia
2014-02-26 15:03                                       ` Yuri D'Elia
2014-02-26  8:16                                     ` Yuri D'Elia

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).