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

InputCommon/DolphinQt: Fix sometimes broken syntax highlighting in IOWindow. #13280

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jordan-woyak
Copy link
Member

@jordan-woyak jordan-woyak commented Jan 17, 2025

QSyntaxHighlighter is a neat idea, allowing just altered "blocks" to be reformatted, but making this work properly requires the parser state be stored for each text block as a single int value, and rigging that up would just be a huge hassle.

Prior to this change only the altered block was re-formatted, hoping other blocks wouldn't need re-formatting, which really isn't a safe assumption.

It seems our expressions are often a single block or are edited left-to-right so a highlighting failure wasn't often seen but incorrect highlighting could be coerced by temporarily deleting delimiters mid-string and whatnot.

This change stops the use of QSyntaxHighlighter and just re-parses and re-formats the entire document on change.
Unicode characters are also now properly handled.

@jordan-woyak jordan-woyak force-pushed the input-expressions-highlighting branch 2 times, most recently from 7f58ecb to e3b0ce9 Compare January 17, 2025 08:40
@jordan-woyak jordan-woyak changed the title DolphinQt: Fix sometimes broken syntax highlighting in IOWindow. InputCommon/DolphinQt: Fix sometimes broken syntax highlighting in IOWindow. Jan 17, 2025
@jordan-woyak jordan-woyak force-pushed the input-expressions-highlighting branch from e3b0ce9 to e91b83d Compare January 17, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant