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,10 +871,9 @@ class CSSWidget(QWidget):
|
||||
if editor is None:
|
||||
return
|
||||
editor = editor.editor
|
||||
block = editor.document().findBlockByNumber(sourceline - 1) # blockNumber() is zero based
|
||||
if block.isValid():
|
||||
block = editor.document().findBlockByNumber(max(0, sourceline - 1)) # blockNumber() is zero based
|
||||
c = editor.textCursor()
|
||||
c.setPosition(block.position())
|
||||
c.setPosition(block.position() if block.isValid() else 0)
|
||||
editor.setTextCursor(c)
|
||||
boss.show_editor(name)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user