From 89ac3b59a41ce2abc8fb91330d229389acf2ecc8 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Mon, 15 Sep 2008 12:37:24 +0000 Subject: [PATCH] Show ellipsis (...) item when there are too many symbol names for autocompletion. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2944 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 9 ++++++++- src/editor.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b461ca9..44eb3a1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,14 @@ +2008-09-15 Nick Treleaven + + * src/editor.c: + Show ellipsis (...) item when there are too many symbol names for + autocompletion. + + 2008-09-14 Frank Lanitz * COPYING: Fixing a little encoding issue in GPL text. - * po/tr.po, po/LINGUAS, src/about.c, THANKS: Adding Turkish translation + * po/tr.po, po/LINGUAS, src/about.c, THANKS: Adding Turkish translation provided by Gürkan Gür. Thanks for it. diff --git a/src/editor.c b/src/editor.c index ca483fc0..18a87ef5 100644 --- a/src/editor.c +++ b/src/editor.c @@ -1397,9 +1397,16 @@ autocomplete_tags(GeanyDocument *doc, const gchar *root, gsize rootlen) GString *words = g_string_sized_new(150); guint j; - for (j = 0; ((j < tags->len) && (j < editor_prefs.autocompletion_max_entries)); ++j) + for (j = 0; j < tags->len; ++j) { - if (j > 0) g_string_append_c(words, '\n'); + if (j > 0) + g_string_append_c(words, '\n'); + + if (j == editor_prefs.autocompletion_max_entries) + { + g_string_append(words, "..."); + break; + } g_string_append(words, ((TMTag *) tags->pdata[j])->name); } show_autocomplete(sci, rootlen, words->str);