From 89a3ddd8648cedf65f5ea54af8a576fb8a96c299 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 6 Jun 2012 21:22:26 -0400 Subject: [PATCH] fetch the whole buffer for completion --- termite.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/termite.c b/termite.c index e0c05d5..46b723f 100644 --- a/termite.c +++ b/termite.c @@ -43,9 +43,12 @@ static gboolean add_to_list_store(char *key, static GtkTreeModel *create_completion_model(VteTerminal *vte) { GtkListStore *store = gtk_list_store_new(1, G_TYPE_STRING); - // TODO: get the full buffer - gchar *content = vte_terminal_get_text(vte, - NULL, NULL, NULL); + glong end_row, end_col; + vte_terminal_get_cursor_position(vte, &end_col, &end_row); + gchar *content = vte_terminal_get_text_range(vte, 0, 0, + end_row, + end_col, + NULL, NULL, NULL); if (!content) { g_printerr("no content");