Skip to content

Commit 02b6873

Browse files
committedSep 10, 2012
fix issue with home key
1 parent 303f0a6 commit 02b6873

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed
 

‎python/console_sci.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def __init__(self, parent=None):
8989
#self.setTabWidth(4)
9090

9191
self.setAutoCompletionThreshold(1)
92-
self.setAutoCompletionSource(self.AcsAPIs)
93-
92+
self.setAutoCompletionSource(self.AcsAPIs)
93+
9494
# Don't want to see the horizontal scrollbar at all
9595
# Use raw message to Scintilla here (all messages are documented
9696
# here: http://www.scintilla.org/ScintillaDoc.html)
@@ -111,9 +111,11 @@ def __init__(self, parent=None):
111111
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('Y')+ ctrl)
112112
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('L')+ ctrl+shift)
113113

114-
## New QShortcut = ctrl+space for Autocomplete
115-
self.newShortcut = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_Space), self)
116-
self.newShortcut.activated.connect(self.autoComplete)
114+
## New QShortcut = ctrl+space/ctrl+alt+space for Autocomplete
115+
self.newShortcutCS = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_Space), self)
116+
self.newShortcutCAS = QShortcut(QKeySequence(Qt.CTRL + Qt.ALT + Qt.Key_Space), self)
117+
self.newShortcutCS.activated.connect(self.autoComplete)
118+
self.newShortcutCAS.activated.connect(self.autoComplete)
117119

118120
def autoComplete(self):
119121
self.autoCompleteFromAll()
@@ -360,6 +362,9 @@ def keyPressEvent(self, e):
360362
elif self.is_cursor_on_last_line():
361363
self.SendScintilla(QsciScintilla.SCI_CLEAR)
362364
e.accept()
365+
elif e.key() == Qt.Key_Home:
366+
self.setCursorPosition(linenr,4)
367+
self.ensureCursorVisible()
363368
elif e.key() == Qt.Key_Down and not self.isListActive():
364369
self.showPrevious()
365370
elif e.key() == Qt.Key_Up and not self.isListActive():

0 commit comments

Comments
 (0)
Please sign in to comment.