Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent widget override #324

Closed
psprint opened this issue May 23, 2016 · 1 comment
Closed

Prevent widget override #324

psprint opened this issue May 23, 2016 · 1 comment

Comments

@psprint
Copy link
Contributor

psprint commented May 23, 2016

Widgets are overridden to call _zle_highlight. How can I prevent this from happening when I know a widget doesn't need to trigger highlighting? In my script, with my widget?

I would say this is possible, because zsh-users/zaw behaves like if it had accomplished this – it's region_highlight setting doesn't disappear when using cursors. One of first things that _zle_highlight does is resetting region_highlight array. I load z-sy-h after zaw.

@danielshahaf
Copy link
Member

I'm not sure what zaw does, but there seem to be two separate issues here:

  1. Perhaps z-sy-h should append to an already existing $region_highlight, rather than discard the existing value.
  2. Given that z-sy-h asks to be registered last, having some form of "widgets not to wrap" might be reasonable. I say "might" because this facility would only be needed in zsh≤5.2 anyway, since ≥5.3 will do away with widget-by-widget wrapping in favour of pre-redraw (redrawhook issues #245).

Let's keep this issue about #2 (feel free to file a separate issue for #1). This should be simple to implement and useful to people running zsh 5.2 or older with latest z-sy-h. That is likely a common setup, so I'm inclined to support this change.

What would the interface by which people specify which widgets should/shouldn't be wrapped be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants