This commit is contained in:
Kovid Goyal 2015-01-22 21:56:50 +05:30
parent 7ee853426a
commit 51d3563b7c

View File

@ -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)
# }}} # }}}