Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Make arrow-key selection in completion widget "roll over" #5771

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion spyder/widgets/sourcecode/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ def keyPressEvent(self, event):
elif key in (Qt.Key_Up, Qt.Key_Down, Qt.Key_PageUp, Qt.Key_PageDown,
Qt.Key_Home, Qt.Key_End,
Qt.Key_CapsLock) and not modifier:
QListWidget.keyPressEvent(self, event)
if key == Qt.Key_Up and self.currentRow() == 0:
self.setCurrentRow(self.count() - 1)
elif key == Qt.Key_Down and self.currentRow() == self.count()-1:
self.setCurrentRow(0)
else:
QListWidget.keyPressEvent(self, event)
elif len(text) or key == Qt.Key_Backspace:
self.textedit.keyPressEvent(event)
self.update_current()
Expand Down