Neil Hodgson:

The exact same situation does work correctly in SciTE?

Yes, it does. However, Notepad2 doesn't use code folding, so maybe the
styling is more up-to-date in SciTE due to some additional calls
concerning folding? Or the container-side handling of the styling?

Check that the SCN_UPDATEUI is from the same Scintilla instance as
is being brace matched.

Ok.

Also look into any explicit changing of styles and the endStyled
position.

Notepad2 doesn't perform any explicit style changing. However,
checking for SCI_GETENDSTYLED reveals that the document is only styled
up to the first (i.e. commented) brace (as referring to my initial
code sample) upon SCN_UPDATEUI.

So I found this workaround: if SCI_GETENDSTYLED < SCI_GETLENGTH, I'm
just calling SCI_COLOURISE, and everything works fine! In fact this is
necessary after each keystroke, but according to the documentation
(SCN_CHARADDED: "... This notification is sent before the character
has been styled so processing that depends on styling should instead
be performed in the SCN_UPDATEUI notification.") I was assuming the
document to be fully styled when SCN_UPDATEUI is received.

Use a debugger to work out what is occurring.

For me, it's sometimes tricky to go into debugging with Scintilla, as
I'm using Scintilla only through the SendMessage() API. So I'd have to
set break-points on either side and match them manually, I don't
manage to directly track down a SendMessage() call to the appropriate
Scintilla code (with my beginner-debugging-skills...).

--Florian
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to