Ticket #423 (assigned defect)
calls to GetStyleAt must mask off indicator bits
| Reported by: | rob | Owned by: | rob |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.15 |
| Component: | stc | Keywords: | |
| Cc: |
Description (last modified by rob) (diff)
Scintilla's GetStyleAt? (and related) methods return all the styling information, including the indicator bits. So, simply checking that the style is the same as the comment style, for instance, is wrong because an indicator may also be applied to that character.
The proper check is:
mask = (2**stc.GetStyleBits()) - 1
style = stc.GetStyleAt(pos) & mask
However, it seems that the end of line character typically won't be marked with an indicator, so if you're only interested in whether or not the line is a multi line comment or multi line string, you can test only the last character.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
