mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 10:43:44 +02:00
Dont set cursor pos beyond end of text when replacing text
This commit is contained in:
parent
862bc734f2
commit
09312b65b2
1 changed files with 1 additions and 1 deletions
|
|
@ -122,7 +122,7 @@ def replace_text(self, text):
|
|||
c.select(c.Document)
|
||||
c.insertText(text)
|
||||
c.endEditBlock()
|
||||
c.setPosition(pos)
|
||||
c.setPosition(min(pos, len(text)))
|
||||
self.setTextCursor(c)
|
||||
self.ensureCursorVisible()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue