Repository navigation
Inherit the editor font for lexer styles (fix tiny text on direct lexer attach) - #10
Open
sonnix-msk wants to merge 1 commit into
Open
sonnix-msk wants to merge 1 commit into
sonnix-msk wants to merge 1 commit into
Conversation
When a lexer is attached directly (auto-detect / session reload) rather than picked from the Language menu, Notepad++ never applies the stylers.xml font to the plugin's styles. Scintilla then keeps its uninitialised style size (0) and the text renders as unreadably tiny glyphs, even though highlighting and line spacing look normal. Copy the font name and size from STYLE_DEFAULT (which Notepad++ points at the global editor font) to the tree-sitter styles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a lexer is attached directly (auto-detect or session reload) instead of being picked from the Language menu, Notepad++ never applies the
stylers.xmlfont to the plugin's styles. Scintilla then keeps its uninitialised style size (0), so the text renders as unreadably tiny glyphs, while colours, indentation and line spacing all look normal. Picking the language from the menu fixes it, because that path fills the styles.ApplyTreeSitterStyleColors()now copies the font name and size fromSTYLE_DEFAULT(which Notepad++ points at the global editor font) to the tree-sitter styles.Repro: enable
Auto-detect Tree-sitter Language, open a file whose extension is mapped so the lexer is attached without a menu click. The text is tiny; after the patch it matches the editor font. Reproduces for every grammar, not just one.