clean up
This commit is contained in:
parent
89a3ddd864
commit
137e8794bb
|
@ -1,7 +1,6 @@
|
||||||
#define _POSIX_C_SOURCE 200809L
|
#define _POSIX_C_SOURCE 200809L
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
@ -45,14 +44,12 @@ static GtkTreeModel *create_completion_model(VteTerminal *vte) {
|
||||||
|
|
||||||
glong end_row, end_col;
|
glong end_row, end_col;
|
||||||
vte_terminal_get_cursor_position(vte, &end_col, &end_row);
|
vte_terminal_get_cursor_position(vte, &end_col, &end_row);
|
||||||
gchar *content = vte_terminal_get_text_range(vte, 0, 0,
|
gchar *content = vte_terminal_get_text_range(vte, 0, 0, end_row, end_col,
|
||||||
end_row,
|
|
||||||
end_col,
|
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
if (!content) {
|
if (!content) {
|
||||||
g_printerr("no content");
|
g_printerr("no content returned for completion");
|
||||||
exit(EXIT_FAILURE);
|
return GTK_TREE_MODEL(store);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *s_ptr = content, *saveptr;
|
char *s_ptr = content, *saveptr;
|
||||||
|
|
Loading…
Reference in New Issue