fix crash when double clicking behind the last char
This commit is contained in:
@@ -81,12 +81,11 @@ class LogFileModel:
|
||||
if len(lines) == 0:
|
||||
return "", -1, -1
|
||||
line: Line = lines[0]
|
||||
if not lines[0].includes_byte(byte_offset):
|
||||
if not line.includes_byte(byte_offset):
|
||||
return "", -1, -1
|
||||
|
||||
offset_in_line = byte_offset - line.byte_offset()
|
||||
char_index = line.byte_index_to_char_index(offset_in_line)
|
||||
# todo char_index may be out of range
|
||||
current_char = line.line()[char_index]
|
||||
if not self._is_word_char(current_char):
|
||||
return current_char, byte_offset, byte_offset + 1
|
||||
|
||||
Reference in New Issue
Block a user