Added history length

This commit is contained in:
Jesse van den Kieboom 2005-12-23 13:22:51 +00:00
parent cca58988b2
commit 1e8b1c9633
1 changed files with 7 additions and 2 deletions

View File

@ -257,7 +257,7 @@ on_gm_world_input_view_key_pressed(GtkWidget *widget, GdkEventKey *event,
GtkTextIter start, end, cursor;
GtkTextMark *insert;
GList *item, *found = NULL;
gint line;
gint line, len;
buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
@ -362,7 +362,12 @@ on_gm_world_input_view_key_pressed(GtkWidget *widget, GdkEventKey *event,
}
}
// TODO: manage history length
len = g_list_length(*view->priv->history);
for (line = 0; line < len - 500; ++line) {
*view->priv->history = g_list_remove(*view->priv->history,
(*view->priv->history)->data);
}
// Append new empty history item which will become our new
// current item