Skip to content

Conversation

@CharlesGueunet
Copy link

Hello,
This PR add a new guard before triggering the $highlight_predicate:
When pressing esc (to go out of vim insert mode), the function was
trigger with an empty string leading to an annoying permission denied.
I have just added a check that $highlight_predicate is not empty.

Charles

When pressing esc (to go out of vim insert mode), the function was
trigger with an empty string leading to an annoying permission denied.
Atyansh added a commit to Atyansh/zsh-syntax-highlighting-filetypes that referenced this pull request Nov 23, 2025
When using this plugin alongside zsh-users/zsh-syntax-highlighting,
pressing backspace or enter on an empty command line produces errors:
- _zsh_highlight-zle-buffer-p:4: permission denied:
- _zsh_highlight-zle-buffer:25: permission denied:
- _zsh_highlight-zle-buffer:27: not an identifier:

This happens because both plugins share internal arrays and the newer
zsh-users plugin registers entries that are incompatible.

Fix:
- Validate highlight_predicate is non-empty before executing
- Validate func exists as callable function before invoking
- Validate cache_place is a valid identifier before assignment

Builds on trapd00r#12 with additional guards.
Atyansh added a commit to Atyansh/zsh-syntax-highlighting-filetypes that referenced this pull request Nov 23, 2025
When using this plugin alongside zsh-users/zsh-syntax-highlighting,
pressing backspace or enter on an empty command line produces errors:
- _zsh_highlight-zle-buffer-p:4: permission denied:
- _zsh_highlight-zle-buffer:25: permission denied:
- _zsh_highlight-zle-buffer:27: not an identifier:

This happens because both plugins share internal arrays and the newer
zsh-users plugin registers entries that are incompatible.

Fix:
- Validate highlight_predicate is non-empty before executing
- Validate func exists as callable function before invoking
- Validate cache_place is a valid identifier before assignment

Builds on trapd00r#12 with additional guards.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant