diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-13 10:40:18 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-13 10:40:18 +0100 |
commit | 3236a520ba677f963b0bba1ce0977a4d99d1df7c (patch) | |
tree | 9929da201584ee957a9e5842c6cda1bc1f8f8d27 | |
parent | e9d53ebec7a17b11761b5fee1c2183cff3110dd5 (diff) | |
download | sciteco-3236a520ba677f963b0bba1ce0977a4d99d1df7c.tar.gz |
when autocompleting, highlight files that are already in the buffer
-rw-r--r-- | cmdline.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cmdline.cpp b/cmdline.cpp index 2f35c5d..db1d1ef 100644 --- a/cmdline.cpp +++ b/cmdline.cpp @@ -232,13 +232,19 @@ filename_complete(const gchar *filename, gchar completed) file != NULL; file = g_list_next(file)) { GtkInfoPopupFileType type; + gboolean in_buffer = FALSE; - type = filename_is_dir((gchar *)file->data) - ? GTK_INFO_POPUP_DIRECTORY - : GTK_INFO_POPUP_FILE; + if (filename_is_dir((gchar *)file->data)) { + type = GTK_INFO_POPUP_DIRECTORY; + } else { + type = GTK_INFO_POPUP_FILE; + /* FIXME: inefficient */ + in_buffer = ring.find((gchar *)file->data) + != NULL; + } gtk_info_popup_add_filename(filename_popup, type, (gchar *)file->data, - FALSE); + in_buffer); } gtk_widget_show(GTK_WIDGET(filename_popup)); |