compute between bytes and chars to get correct clipboard copy

This commit is contained in:
2021-10-25 17:52:14 +02:00
parent b8eb62a3bf
commit 7002e91a35
4 changed files with 28 additions and 12 deletions

View File

@@ -168,8 +168,8 @@ class InnerBigText(QWidget):
column_in_line = self.x_pos_to_column(e.pos().x()) + self._left_offset
char_in_line = min(column_in_line, line.length())
# print("%s in line %s" % (char_in_line, line_number))
current_byte = line.byte_offset() + char_in_line
byte_in_line = line.char_index_to_byte(char_in_line)
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()