fix crash when double clicking behind the last char

This commit is contained in:
2021-11-26 18:43:12 +01:00
parent 0e27cb2b26
commit b3e5d535b7
2 changed files with 3 additions and 4 deletions

View File

@@ -312,10 +312,10 @@ class InnerBigText(QWidget):
char_in_line = line.column_to_char(column_in_line)
# print("%s in line %s" % (char_in_line, line_number))
byte_in_line = line.char_index_to_byte(char_in_line)
current_byte = line.byte_offset() + byte_in_line
current_byte = line.byte_offset() + byte_in_line - 1
# print("%s + %s = %s" % (line.byte_offset(), char_in_line, current_byte))
else:
current_byte = self.model.byte_count()
current_byte = self.model.byte_count() - 1
return current_byte
def _has_selection(self):