aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-03-26 17:49:08 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-03-26 17:49:08 -0400
commit6e508c391e0ea25e6cc3e607738b8acc73793f41 (patch)
treedb553508a00724edcc04bd672114019bd597fadf
parentb75d134f6a725b2d51257f0df2e6863014b3e5b8 (diff)
downloadtextadept-6e508c391e0ea25e6cc3e607738b8acc73793f41.tar.gz
textadept-6e508c391e0ea25e6cc3e607738b8acc73793f41.zip
Fixed GUI find history.
The wrong end of the history was being overwritten.
-rw-r--r--src/textadept.c6
1 files changed, 3 insertions, 3 deletions
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),