From d23a707458103854e2d26508dd7c08e85c4b2dc6 Mon Sep 17 00:00:00 2001 From: Andreas Hammer Date: Fri, 5 Mar 2021 15:55:09 +0100 Subject: [PATCH] Fixed completion dialog wrap arround navigation --- src/selection_dialog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/selection_dialog.cpp b/src/selection_dialog.cpp index c652b55..fc6ba80 100644 --- a/src/selection_dialog.cpp +++ b/src/selection_dialog.cpp @@ -432,6 +432,10 @@ bool CompletionDialog::on_key_press(GdkEventKey *event) { list_view_text.set_cursor(list_view_text.get_model()->get_path(it)); cursor_changed(); } + else { + list_view_text.set_cursor(list_view_text.get_model()->get_path(list_view_text.get_model()->children().begin())); + cursor_changed(); + } } else list_view_text.set_cursor(list_view_text.get_model()->get_path(list_view_text.get_model()->children().begin())); @@ -446,6 +450,14 @@ bool CompletionDialog::on_key_press(GdkEventKey *event) { list_view_text.set_cursor(list_view_text.get_model()->get_path(it)); cursor_changed(); } + else { + auto last_it = list_view_text.get_model()->children().end(); + last_it--; + if(last_it) { + list_view_text.set_cursor(list_view_text.get_model()->get_path(last_it)); + cursor_changed(); + } + } } else { auto last_it = list_view_text.get_model()->children().end();