Open Moosems opened 1 year ago
Could you review the plan and give your thoughts/ideas/suggestions/changes?
I like your plan. The only thing I have concerns about is the emoji-in-tag-range checking thingy. I'm not sure how would it perform.
Check for a set of characters in the text, if any ranges are found, remove it from any relevant tags (might make a method that takes the tokens and tags and areas to remove and returns the tags without those areas).
Check for a set of characters in the text, if any ranges are found, remove it from any relevant tags (might make a method that takes the tokens and tags and areas to remove and returns the tags without those areas).
But that would run on every keypress?
Oh no
Yes, this runs on every keypress. Maybe I should add a check at the beginning of the method to check if anything has changed and if something has, only then will it all run. Another check could be if the return key was pressed and only highlight the whole thing in that case because otherwise only the line with the cursor needs to be changed.
A method to scroll to where someone types that works properly is also in order.
@rdbende, this runsbefore the highlighting. The issue? The check for MLCDS tags relies on checking for "Token.Literal.String.Doc", "Token.Comment.Multiline", "Token.Literal.String.Backtick"
Tokens. What would you recommend? My thought is lex the line with the cursor if it is an insert, removal, or replacement event and use that to determine in that case if the MLCDS tags need updating.
I wonder if it's the lexing or tags that takes up the computation time. If it's just the tags then it wouldn't be that hard to simply add the tags that are in the visible area and lex the whole files such that MLCDS isn't an issue otherwise it's going to be the whole arduous process.
Here's the current plan:
In summary, the changes will make the text widget display only the visible area, while adding the necessary context outside the viewport using MLCDS tags.