This commit is contained in:
Kovid Goyal 2019-06-29 09:08:30 +05:30
parent f410ca5e78
commit 4ae788561b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -128,6 +128,9 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{
def set_readonly(self, what): def set_readonly(self, what):
self.readonly = what self.readonly = what
def focus_self(self):
self.setFocus(Qt.TabFocusReason)
def do_clear(self, *args): def do_clear(self, *args):
c = self.textCursor() c = self.textCursor()
c.beginEditBlock() c.beginEditBlock()
@ -135,7 +138,7 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{
c.movePosition(QTextCursor.End, QTextCursor.KeepAnchor) c.movePosition(QTextCursor.End, QTextCursor.KeepAnchor)
c.removeSelectedText() c.removeSelectedText()
c.endEditBlock() c.endEditBlock()
self.setFocus(Qt.OtherFocusReason) self.focus_self()
clear_text = do_clear clear_text = do_clear
def do_bold(self): def do_bold(self):