Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
widget special PREFIX variable and cursor position with complete_in_word
- X-seq: zsh-users 18432
- From: Yuri D'Elia <wavexx@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: widget special PREFIX variable and cursor position with complete_in_word
- Date: Wed, 12 Feb 2014 22:02:30 +0100
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author