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

Unmatched parenthesis in singly-quoted string will desperately attempt to match with a regular parenthesis outside said string #1224

Open
samuelmarquis opened this issue Dec 23, 2024 · 3 comments

Comments

@samuelmarquis
Copy link

samuelmarquis commented Dec 23, 2024

Problem

image
image

Steps to reproduce

( '(' )) is balanced

vis version (vis -v)

vis v0.9-git +curses +lua +tre +acl +selinux

Terminal name/version

No response

$TERM environment variable

No response

@samuelmarquis
Copy link
Author

samuelmarquis commented Dec 23, 2024

Note: only with single quotes, not double quotes.

Does this come down to "what does the lexer say is a string/comment(?)" or is there something internal that handles it?

@samuelmarquis samuelmarquis changed the title Unmatched parenthesis in string will desperately attempt to match with a regular parenthesis outside said string Unmatched parenthesis in singly-quoted string will desperately attempt to match with a regular parenthesis outside said string Dec 23, 2024
@fischerling
Copy link
Contributor

The problem is that drawing matching cursors is independent of the syntax and build into the editor core.
You can verify this by using a plain text file without any syntax.

The function window_draw_cursor_matching (vis.c:292) responsibly for styling matching symbols, uses text_bracket_match_symbol (text-motions.c:572) internally, which naively searches for bytes in a certain direction.

Maybe the styling of matching symbols should be moved to lua if a syntax is available.

@samuelmarquis
Copy link
Author

samuelmarquis commented Dec 25, 2024

Thanks for the pointer, I'll mess around with this and send a PR if I get it figured out. Do you guys prefer/prioritize PRs on the mailing list, or is here fine?

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

No branches or pull requests

2 participants