Commit 2b6a1689 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Don't wrap around the completion list when auto-repeating

It can be a bit disturbing if the list suddenly jumps when you don't
release the down or up key in time.

Done with mae.
parent 6894cd0b
......@@ -166,14 +166,16 @@ bool CompletionWidget::event(QEvent *e)
closeList(currentIndex());
return true;
case Qt::Key_Up:
if (currentIndex().row() == 0) {
if (!ke->isAutoRepeat()
&& currentIndex().row() == 0) {
setCurrentIndex(model()->index(model()->rowCount()-1, 0));
return true;
}
forwardKeys = false;
break;
case Qt::Key_Down:
if (currentIndex().row() == model()->rowCount()-1) {
if (!ke->isAutoRepeat()
&& currentIndex().row() == model()->rowCount()-1) {
setCurrentIndex(model()->index(0, 0));
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment