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

Re: PATCH: Add an option to disable deactivating region hilighting whenever you edit something



Mikael Magnusson wrote:
> 
> While we're on the topic of deactivating the region, I've had this
> patch lying around forever in my local tree, but never cared enough to
> send it. It just keeps the region on until the user disables it again, I
> use this very complicated widget:

I'm concerned that, as is often the case with options, it is a somewhat
blunt instrument. It isn't just edits that this affects. Most vi
commands too: I'd want the option set for vi command mode but not for
vi insert mode. That said, the use case you show is quite nice. The
region should be more flexible (and I have some stuff coming in this
area which I probably now need to start unloading).

Currently, the region is fixed to an emacs region model so
'region_active = 0' typically appears in shared code. We need control to
move up to individual widgets somewhat more.

I can think of a few ways this might be more versatile, setting a
flag on the zle widget so you might mark self-insert as being region
preserving might be one option. I've pondered adding this for completion
suffix removal too. We also have some prefix widgets such as for numeric
arguments which affect the behaviour of the following widget.

If we do go with the option, I'll have a think about the name.

Oliver



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