aboutsummaryrefslogtreecommitdiffstats
path: root/Lib/defconQt/featureTextEditor.py
diff options
context:
space:
mode:
authorAdrien Tétar2015-07-10 02:00:56 +0200
committerAdrien Tétar2015-07-10 02:00:56 +0200
commitc9b90eb726ec51092695536ec4d0cfcde6013e70 (patch)
tree8cc19324c4d53486c4d5644152b1559ce1563540 /Lib/defconQt/featureTextEditor.py
parent079519442b53c74ca545e92ed42247111695f74f (diff)
downloadtrufont-c9b90eb726ec51092695536ec4d0cfcde6013e70.tar.bz2
spaceCenter: beef up bbox display
Diffstat (limited to 'Lib/defconQt/featureTextEditor.py')
-rw-r--r--Lib/defconQt/featureTextEditor.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/defconQt/featureTextEditor.py b/Lib/defconQt/featureTextEditor.py
index 5363034..4458ba1 100644
--- a/Lib/defconQt/featureTextEditor.py
+++ b/Lib/defconQt/featureTextEditor.py
@@ -158,7 +158,8 @@ class TextEditor(QPlainTextEdit):
return indent
def keyPressEvent(self, event):
- if event.key() == Qt.Key_Return:
+ key = event.key()
+ if key == Qt.Key_Return:
cursor = self.textCursor()
indentLvl = self.findLineIndentLevel(cursor)
newBlock = False
@@ -200,10 +201,10 @@ class TextEditor(QPlainTextEdit):
cursor.movePosition(QTextCursor.Up)
cursor.movePosition(QTextCursor.EndOfLine)
self.setTextCursor(cursor)
- elif event.key() == Qt.Key_Tab:
+ elif key == Qt.Key_Tab:
cursor = self.textCursor()
cursor.insertText(self._indent)
- elif event.key() == Qt.Key_Backspace:
+ elif key == Qt.Key_Backspace:
cursor = self.textCursor()
cursor.movePosition(QTextCursor.PreviousCharacter, QTextCursor.KeepAnchor,
len(self._indent))