mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont set cursor pos beyond end of text when replacing text
This commit is contained in:
parent
862bc734f2
commit
09312b65b2
@ -122,7 +122,7 @@ class TextEdit(QPlainTextEdit):
|
||||
c.select(c.Document)
|
||||
c.insertText(text)
|
||||
c.endEditBlock()
|
||||
c.setPosition(pos)
|
||||
c.setPosition(min(pos, len(text)))
|
||||
self.setTextCursor(c)
|
||||
self.ensureCursorVisible()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user