Ticket #423 (assigned defect)

Opened 4 years ago

Last modified 12 months ago

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

Changed 4 years ago by rob

  • status changed from new to assigned
  • description modified (diff)

Changed 4 years ago by rob

  • milestone changed from 0.7.4 to 0.7.5

Changed 12 months ago by rob

(In [2642]) Refs #423: added style mask to findSameStyle

  • was failing on spell-checked comments

Add/Change #423 (calls to GetStyleAt must mask off indicator bits)

Author


E-mail address and user name can be saved in the Preferences.


Action
as assigned
 
Note: See TracTickets for help on using tickets.