fix exception when selecting text by clicking behind the last character

This commit is contained in:
2025-04-06 19:02:33 +02:00
parent d36724f3e7
commit 9afc4d1d9c
2 changed files with 5 additions and 2 deletions

View File

@@ -479,7 +479,7 @@ class InnerBigText(QWidget):
# # print("%s + %s = %s" % (line.byte_offset(), char_in_line, current_byte))
else:
current_byte = self.model.byte_count()
return current_byte
return SelectionPos(current_byte, True, 1)
def elided_text(self, text: str, width: int):
w = width + self.font_metric.horizontalAdvance("")
@@ -557,7 +557,6 @@ class InnerBigText(QWidget):
def _toggle_follow(self):
self._follow = not self._follow
print(f"follow={self._follow}")
self.update()
def _update_highlight_selected_text(self):