Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: cursor position after completion



Felix Rosencrantz wrote:

> I would like to request a different solution to cursor positioning with
> completion and matching control.

I found myself in situations where I wanted that, too (after the patch)...

> When I'm completing filenames where matching control occurs, I'd prefer
> the cursor to move to the position of the first place where characters
> are missing, not the last.  If I'm completing something that might be 
> an option I would like to have it put me in the last position.

... but I don't think the type of completion is the right thing to base the
decision upon.

> So to me the questions are:
> 
>    How should ZSH decide at which matching hot spot to leave the cursor?
> 
>    If it makes the wrong choice, is there a better way for the user to
>    correct the position and continue completing?
> 
> It seems that there should be a more intuitive solution.  I think there
> are alternatives to counting matches.
> 
> Maybe a simple mechanism that would allow the user to cycle the
> cursor through the matching hot spots of a word.  Maybe before menu
> completion kicks in the cursor could be moved to the different hot
> spots.  Though this might be annoying, too.

And since a cycle is endless this doesn't seem to make much sense to
me. We could add a builtin widget which doesn't break the current
completion state and cycles through the positions or we add a special
array available only in widgets containing the positions so that we
could write a shell function widget doing anything that may seem
useful (or two widget: move backward and forward to the previous/next
interesting position).

> Maybe it would it be useful if there was a parameter to configure if you
> prefer the cursor to be positioned at the first or last hot spot.
> Or maybe the matching control specifications could be enhanced with cursor
> positioning rules.

That's another idea I hadn't thought about. But I can't think of
*what* we could make expressible this way.

>
> ...
> 
> I guess I just want it to dwim.  One of the reasons, I moved from tcsh to zsh,
> is that zsh does matching control, that handles partial completion &
> case-sensitivity issues so much better.  But this new behavior doesn't feel
> quite right.

Yes, it's hard to find the right thing. I'd like to hear about any
ideas any of you have about this. Or just observations and
descriptions of the circumstances when the code did the wrong thing.

Every help with this is very much appreciated.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author