mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-06 05:35:22 +01:00
Handle case when col number moves cursor more than one line past the originating line
This commit is contained in:
parent
f383456f52
commit
d28c4b5358
1 changed files with 2 additions and 1 deletions
|
|
@ -198,7 +198,8 @@ def go_to_line(self, lnum, col=None):
|
|||
else:
|
||||
c.setPosition(c.block().position() + col)
|
||||
if c.blockNumber() + 1 > lnum:
|
||||
c.movePosition(c.PreviousBlock)
|
||||
# We have moved past the end of the line
|
||||
c.setPosition(c.block().position())
|
||||
c.movePosition(c.EndOfBlock)
|
||||
self.setTextCursor(c)
|
||||
self.ensureCursorVisible()
|
||||
|
|
|
|||
Loading…
Reference in a new issue