Skip to content

Fix ugly semantic coloring on CSL languages while editing#8018

Merged
lkishalmi merged 1 commit intoapache:masterfrom
lkishalmi:csl-highlighter-fix-1
Dec 5, 2024
Merged

Fix ugly semantic coloring on CSL languages while editing#8018
lkishalmi merged 1 commit intoapache:masterfrom
lkishalmi:csl-highlighter-fix-1

Conversation

@lkishalmi
Copy link
Copy Markdown
Contributor

@lkishalmi lkishalmi commented Dec 4, 2024

This one is bugging me for years.

Whenever I insert or write text to a CSL based editor the semantic coloring does not keep track with the document change
and some text elements get discolored as you type. The next parsing run would then set the colors right.

See the discoloration of permissions before:
Screencast From 2024-12-01 13-04-47.webm

After this fix:
Screencast From 2024-12-01 13-07-58.webm

This one would supersede #8011 contains the fix only. The rest of the code changes will be in a separate PR.

@lkishalmi lkishalmi added this to the NB25 milestone Dec 4, 2024
@mbien mbien added CSL [ci] enable web job Editor ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Dec 4, 2024
@apache apache locked and limited conversation to collaborators Dec 4, 2024
@apache apache unlocked this conversation Dec 4, 2024
Copy link
Copy Markdown
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding dropping the Math.min with nextElementStartOffset makes sense as the ranges end is shifted according to the edits, while nextElementStartOffset is not updated and held at the original offset.

For the followup commit nextElementStartOffset can be removed as it is not used anymore and thus the updateNextElementStartOffset method can be simplified.

@lkishalmi
Copy link
Copy Markdown
Contributor Author

Yes. This will be simplified in the upcoming PR, where I'm addressing the issues in the semantic package.

@lkishalmi lkishalmi merged commit 1261641 into apache:master Dec 5, 2024
@mbien
Copy link
Copy Markdown
Member

mbien commented Dec 6, 2024

@lkishalmi I updated the PR text with the first paragraph of the other PR which included the videos. So that it is easier to parse when accessed from the release notes. Please check that everything is ok.

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

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) CSL [ci] enable web job Editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants