Probably mostly of interest to Neil...
I'm using this code to drive squiggling with the new decorator API.
It's working fine everywhere (nice work, Neil), except it seems to
break on the first line of a buffer.
Here's the significant parts of code. Yes, '15' and '16' will
be replaced by named constants...
On startup:
for i in [15,16]:
scimoz.indicSetUnder(i, True) # draw under
scimoz.indicSetStyle(i, scimoz.INDIC_SQUIGGLE)
scimoz.indicSetFore(15, RGB(0xff,0,0))
scimoz.indicSetFore(16, RGB(0x00, 0x80,0))
On error:
scimoz.indicatorCurrent = (value == r.SEV_ERROR and 15 or 16)
scimoz.indicatorFillRange(start, length)
I'm testing with a JavaScript file that starts with this text:
+=========== top
function = 'unclosed string
x = = = = 22;
class A {
xxx;
}
// I realize most of this isn't valid JS -- I'm testing syntax error indicators
after all...
+============ bottom
Here's some logging info:
DEBUG: KoLintDisplayer: entering display
DEBUG: KoLintDisplayer: Normal: (offsetStart=2, length=29, r.severity=2)
DEBUG: KoLintDisplayer: Coloring 2: 2:31
DecorationList::FillRange(currentIndicator:15, position:2, fillLength:)29
RunStyles::FillRange(position=2, value=1, fillLength=29
144: runStart=1 position=2 fillLength=29
DEBUG: KoLintDisplayer: leaving display
The squiggle indicator appears in the expected place.
Now when I delete that empty line at the start of the above snippet,
I get this log:
DEBUG: KoLintDisplayer: entering display
DEBUG: KoLintDisplayer: Normal: (offsetStart=0, length=29, r.severity=2)
DEBUG: KoLintDisplayer: Coloring 2: 0:29
DecorationList::FillRange(currentIndicator:15, position:0, fillLength:)29
RunStyles::FillRange(position=0, value=1, fillLength=29
144: runStart=0 position=0 fillLength=29
151: remove runStart=0
current->Empty() is true, deleting curr Ind
DEBUG: KoLintDisplayer: leaving display
The '144' and '151' refer to lines in scintilla/src/RunStyles.cxx
It looks like it deleted the indicator I just laid down because it
has only one partition, but I didn't dive in further.
Thanks,
Eric
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest