fix highlighting for selections
This commit is contained in:
17
bigtext.py
17
bigtext.py
@@ -1,9 +1,7 @@
|
||||
import math
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
from typing import Optional, List, Callable
|
||||
import PyQt6.QtGui
|
||||
from typing import Callable
|
||||
from PyQt6 import QtGui
|
||||
|
||||
from PyQt6.QtCore import *
|
||||
@@ -14,20 +12,17 @@ from PyQt6.QtWidgets import *
|
||||
import constants
|
||||
from ScaledScrollBar import ScaledScrollBar
|
||||
from conversion import humanbytes
|
||||
from highlight import Highlight
|
||||
from highlight_regex import HighlightRegex
|
||||
from highlight_selection import HighlightSelection
|
||||
from highlighted_range import HighlightedRange
|
||||
from highlightingdialog import HighlightingDialog
|
||||
from line import Line
|
||||
from logFileModel import LogFileModel
|
||||
import re
|
||||
|
||||
|
||||
from ravenui import RavenUI
|
||||
from settings import Settings
|
||||
from watchdog.observers import Observer
|
||||
from watchdog.events import FileSystemEventHandler
|
||||
import threading
|
||||
|
||||
|
||||
|
||||
class FileObserver(FileSystemEventHandler):
|
||||
@@ -310,12 +305,12 @@ class InnerBigText(QWidget):
|
||||
column_in_line = self.x_pos_to_column(e.pos().x()) + self._left_offset
|
||||
column_in_line = min(column_in_line, line.length()) # x was behind the last column of this line
|
||||
char_in_line = line.column_to_char(column_in_line)
|
||||
# print("%s in line %s" % (char_in_line, line_number))
|
||||
# print("%s in line %s lcolumn_in_line=%s" % (char_in_line, line_number, column_in_line))
|
||||
byte_in_line = line.char_index_to_byte(char_in_line)
|
||||
current_byte = line.byte_offset() + byte_in_line - 1
|
||||
current_byte = line.byte_offset() + byte_in_line
|
||||
# print("%s + %s = %s" % (line.byte_offset(), char_in_line, current_byte))
|
||||
else:
|
||||
current_byte = self.model.byte_count() - 1
|
||||
current_byte = self.model.byte_count()
|
||||
return current_byte
|
||||
|
||||
def _has_selection(self):
|
||||
|
||||
Reference in New Issue
Block a user