Skip to content

Inherit the editor font for lexer styles (fix tiny text on direct lexer attach) - #10

Open
sonnix-msk wants to merge 1 commit into
Thorium:masterfrom
sonnix-msk:sonnix/styles
Open

sonnix-msk wants to merge 1 commit into
Thorium:masterfrom
sonnix-msk:sonnix/styles

Conversation

@sonnix-msk

Copy link
Copy Markdown

When a lexer is attached directly (auto-detect or session reload) instead of being 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), 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 from STYLE_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.

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.
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

Successfully merging this pull request may close these issues.

1 participant