From 6e508c391e0ea25e6cc3e607738b8acc73793f41 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 26 Mar 2020 17:49:08 -0400 Subject: Fixed GUI find history. The wrong end of the history was being overwritten. --- src/textadept.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/textadept.c') diff --git a/src/textadept.c b/src/textadept.c index 2837a5d1..80544d0a 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -286,9 +286,9 @@ static void add_to_history(ListStore* store, const char *text) { // navigation, append to the list instead of prepending to it. int n = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); GtkTreeIter iter; - if (n > 10) - gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, --n), - gtk_list_store_remove(store, &iter); // keep 10 items + if (n > 9) + gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter), + gtk_list_store_remove(store, &iter), n--; // keep 10 items char *last_text = NULL; if (n > 0) gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, n - 1), -- cgit v1.2.3