mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2024-06-28 21:29:48 +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
|
start, end = end, start
|
||||||
s[start:end] |= style_bits
|
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):
|
def get_style_ranges(self, **kwargs):
|
||||||
style_bits = self.get_style_bits(**kwargs)
|
style_bits = self.get_style_bits(**kwargs)
|
||||||
matches = (self.style & style_bits) > 0
|
matches = (self.style & style_bits) > 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user