mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2025-01-16 18:32:35 +00:00
Added clear_style_ranges
This commit is contained in:
parent
31085bd83e
commit
3c2f6df828
@ -98,6 +98,14 @@ class DefaultSegment(object):
|
||||
start, end = end, start
|
||||
s[start:end] |= style_bits
|
||||
|
||||
def clear_style_ranges(self, ranges, **kwargs):
|
||||
style_mask = self.get_style_mask(**kwargs)
|
||||
s = self.style
|
||||
for start, end in ranges:
|
||||
if end < start:
|
||||
start, end = end, start
|
||||
s[start:end] &= style_mask
|
||||
|
||||
def get_style_ranges(self, **kwargs):
|
||||
style_bits = self.get_style_bits(**kwargs)
|
||||
matches = (self.style & style_bits) > 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user