SCI_STYLERESETDEFAULT impact on textHeight()

Thomas Lübking thomas.luebking at gmail.com
Fri Sep 3 09:09:47 BST 2021


This is probably the same issue as
https://www.riverbankcomputing.com/pipermail/qscintilla/2021-February/001489.html

Setting a lexer will detach() any existing lexer which will call
SendScintilla(SCI_STYLERESETDEFAULT); and as a result the textHeight()
(SCI_TEXTHEIGHT) will grow to I assume some internal default which is
not related to any font I set before or afterwards - whether on the
lexer or the widget (using the cpp API and I bound a shortcut to
SendScintilla(SCI_STYLERESETDEFAULT) to ensure it's the direct cause)

It's also not extraAscent/Descent and I can't figure why it's causing
this or how to undo it.

1. Any idea how to deal with that?
2. Is the SCI_STYLERESETDEFAULT call strictly necessary?
(It also causes the text background to reset to, well, not the paper
color I set and if the lexer is nullptr, the only way I figured to
clear that was to completely reset the text - I've not yet investigated
sending an explicit SCI_STYLECLEARALL)

Cheers,
Thomas


More information about the QScintilla mailing list