diff --git a/src/completion/katecompletiontree.cpp b/src/completion/katecompletiontree.cpp --- a/src/completion/katecompletiontree.cpp +++ b/src/completion/katecompletiontree.cpp @@ -338,12 +338,13 @@ current = moveCursor(MoveDown, Qt::NoModifier); if (current != oldCurrent && current.isValid()) { + // selection posotion will change -> move to the next position setCurrentIndex(current); } else { - if (firstCurrent.isValid()) { - setCurrentIndex(firstCurrent); - } - return false; + // selection position will not change - means we're already at bottom + // so wrap around to top + top(); + return true; } } while (!kateModel()->indexIsItem(current)); @@ -365,10 +366,8 @@ setCurrentIndex(current); } else { - if (firstCurrent.isValid()) { - setCurrentIndex(firstCurrent); - } - return false; + bottom(); + return true; } } while (!kateModel()->indexIsItem(current));