Paul K
2014-01-21 06:44:20 UTC
Hi All,
I've been trying to iterate over a particular indicator and ran into an
issue most likely caused by my misunderstanding of the API. I see that
there are SCI_INDICATORSTART(int indicator, int position) and SCI_INDICATOREND(int
indicator, int position) messages, and I thought that
indicatorstart/indicatorend would give me start/end position of the next
indicator location, but this is not what I'm getting (e is the instance of
0
1
3
It seems like IteratorEnd gives me the next indicator boundary (start and
end) after the specified position and IteratorStart gives me the same
boundary, but at or before the specified position.
I checked the logic of DecorationList::Start and ::End calls and it does
seem like they iterate over partitions based on the specified position, but
if the position is outside of the indicator of interest, then start/end
mark the beginning and end of *that* partition (0,0 in my example), even
though I'm interested in the next one (1,2 in my example).
This is probably not a big deal as I can come up with the logic to iterate
over indicators using this API, but it's a bit different from my reading of
the documentation and from some of the examples I've seen
(https://groups.google.com/d/msg/scintilla-interest/KIetTCwFGhU/P0jht7bgQ9YJ),
so I'd like to confirm that I understand the API correctly. This is using
wxSTC based on Scintilla 3.2.1.
Paul.
I've been trying to iterate over a particular indicator and ran into an
issue most likely caused by my misunderstanding of the API. I see that
there are SCI_INDICATORSTART(int indicator, int position) and SCI_INDICATOREND(int
indicator, int position) messages, and I thought that
indicatorstart/indicatorend would give me start/end position of the next
indicator location, but this is not what I'm getting (e is the instance of
e:SetText('0123456789')
e:SetIndicatorCurrent(0)
e:IndicatorFillRange(1, 2)
e:IndicatorStart(0, 0) --<-- I expect here to get the start of the next
indicator from 0, which is 1e:SetIndicatorCurrent(0)
e:IndicatorFillRange(1, 2)
e:IndicatorStart(0, 0) --<-- I expect here to get the start of the next
0
e:IndicatorEnd(0, 0) --<-- I expect here to get the end of the next
indicator from 0, which is 21
e:IndicatorEnd(0, 1) --<-- I expect 2 here, but get 3, which seems to be
the start of the next partition3
e:IndicatorStart(0, e:GetLength())
10e:IndicatorStart(0, 9)
3e:IndicatorStart(0, 2) --<-- I expect 1 here and this is what I get
1It seems like IteratorEnd gives me the next indicator boundary (start and
end) after the specified position and IteratorStart gives me the same
boundary, but at or before the specified position.
I checked the logic of DecorationList::Start and ::End calls and it does
seem like they iterate over partitions based on the specified position, but
if the position is outside of the indicator of interest, then start/end
mark the beginning and end of *that* partition (0,0 in my example), even
though I'm interested in the next one (1,2 in my example).
This is probably not a big deal as I can come up with the logic to iterate
over indicators using this API, but it's a bit different from my reading of
the documentation and from some of the examples I've seen
(https://groups.google.com/d/msg/scintilla-interest/KIetTCwFGhU/P0jht7bgQ9YJ),
so I'd like to confirm that I understand the API correctly. This is using
wxSTC based on Scintilla 3.2.1.
Paul.
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.