mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
7ee853426a
commit
51d3563b7c
@ -871,11 +871,10 @@ class CSSWidget(QWidget):
|
|||||||
if editor is None:
|
if editor is None:
|
||||||
return
|
return
|
||||||
editor = editor.editor
|
editor = editor.editor
|
||||||
block = editor.document().findBlockByNumber(sourceline - 1) # blockNumber() is zero based
|
block = editor.document().findBlockByNumber(max(0, sourceline - 1)) # blockNumber() is zero based
|
||||||
if block.isValid():
|
c = editor.textCursor()
|
||||||
c = editor.textCursor()
|
c.setPosition(block.position() if block.isValid() else 0)
|
||||||
c.setPosition(block.position())
|
editor.setTextCursor(c)
|
||||||
editor.setTextCursor(c)
|
|
||||||
boss.show_editor(name)
|
boss.show_editor(name)
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user