separate highlight selection from other selections

will make it easier to manage other selections externally
This commit is contained in:
2021-10-25 17:26:00 +02:00
parent 76d4dccf1d
commit b8eb62a3bf
2 changed files with 9 additions and 13 deletions

View File

@@ -11,10 +11,8 @@ from settings import Settings
class HighlightSelection(Highlight):
def __init__(self, start_byte: int, end_byte: int):
self.start_byte = start_byte
self.end_byte = end_byte
start_byte = 0
end_byte = 0
def set_start(self, start_byte):
self.start_byte = start_byte
@@ -33,9 +31,9 @@ class HighlightSelection(Highlight):
start = 0
if line.includes_byte(end):
length = end - line.byte_offset() - start
length = end - line.byte_offset() - start
else:
length = Settings.max_line_length() -start
length = Settings.max_line_length() - start
return [HighlightedRange(start, length, brush=QBrush(QColor(156, 215, 255)), pen=Qt.PenStyle.NoPen)]
else: