Skip to content

Prevent widget override #324

@psprint

Description

@psprint
Contributor

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.

Activity

danielshahaf

danielshahaf commented on May 24, 2016

@danielshahaf
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?

added a commit that references this issue on Apr 6, 2024
c14fcad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @danielshahaf@psprint

        Issue actions

          Prevent widget override · Issue #324 · zsh-users/zsh-syntax-highlighting