[gtksourceview/gtksourcecompletion] Fixed checks on word length
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtksourceview/gtksourcecompletion] Fixed checks on word length
- Date: Mon, 21 Sep 2009 21:29:08 +0000 (UTC)
commit 47ce95f5ce17bc17b21a52dfb05d8c0a1f8ee1c0
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Mon Sep 21 23:28:52 2009 +0200
Fixed checks on word length
.../words/gtksourcecompletionwords.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwords.c b/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
index 2aecda1..1f3d5d2 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
@@ -172,7 +172,8 @@ add_in_idle (GtkSourceCompletionWords *words)
gboolean finished;
/* Don't complete empty string (when word == NULL) */
- if (words->priv->word == NULL)
+ if (words->priv->word == NULL ||
+ g_utf8_strlen (words->priv->word, -1) < words->priv->minimum_word_size)
{
gtk_source_completion_context_add_proposals (words->priv->context,
GTK_SOURCE_COMPLETION_PROVIDER (words),
@@ -239,8 +240,7 @@ gtk_source_completion_words_match (GtkSourceCompletionProvider *provider,
gtk_source_completion_context_get_iter (context, &iter);
word = get_word_at_iter (words, &iter);
- ret = g_utf8_strlen (word, -1) >= words->priv->minimum_word_size;
-
+ ret = word != NULL && g_utf8_strlen (word, -1) >= words->priv->minimum_word_size;
g_free (word);
return ret;
@@ -259,8 +259,10 @@ gtk_source_completion_words_populate (GtkSourceCompletionProvider *provider,
g_free (words->priv->word);
word = get_word_at_iter (words, &iter);
- if (word == NULL)
+ if (word == NULL ||
+ g_utf8_strlen (word, -1) < words->priv->minimum_word_size)
{
+ g_free (word);
gtk_source_completion_context_add_proposals (context,
provider,
NULL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]