Added history length
This commit is contained in:
parent
cca58988b2
commit
1e8b1c9633
|
@ -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
|
||||
|
|
Reference in New Issue