[gtksourceview] CompletionWords: remove trailspaces
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] CompletionWords: remove trailspaces
- Date: Mon, 20 May 2013 12:45:22 +0000 (UTC)
commit ebff517f2d9446400c5ca4d5b17d126d9d873edc
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun May 19 22:03:11 2013 +0200
CompletionWords: remove trailspaces
.../words/gtksourcecompletionwords.c | 108 ++++++++++----------
.../words/gtksourcecompletionwords.h | 4 +-
.../words/gtksourcecompletionwordsbuffer.h | 2 +-
.../words/gtksourcecompletionwordslibrary.c | 92 ++++++++--------
.../words/gtksourcecompletionwordsproposal.c | 26 +++---
.../words/gtksourcecompletionwordsproposal.h | 2 +-
.../words/gtksourcecompletionwordsutils.c | 18 ++--
7 files changed, 126 insertions(+), 126 deletions(-)
---
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
b/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
index a57986e..c4dac32 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
@@ -47,7 +47,7 @@
enum
{
PROP_0,
-
+
PROP_NAME,
PROP_ICON,
PROP_PROPOSALS_BATCH_SIZE,
@@ -65,16 +65,16 @@ struct _GtkSourceCompletionWordsPrivate
gchar *word;
gint word_len;
guint idle_id;
-
+
GtkSourceCompletionContext *context;
GSequenceIter *populate_iter;
guint cancel_id;
-
+
guint proposals_batch_size;
guint scan_batch_size;
guint minimum_word_size;
-
+
GtkSourceCompletionWordsLibrary *library;
GList *buffers;
@@ -109,7 +109,7 @@ gtk_source_completion_words_get_name (GtkSourceCompletionProvider *self)
return g_strdup (GTK_SOURCE_COMPLETION_WORDS (self)->priv->name);
}
-static GdkPixbuf *
+static GdkPixbuf *
gtk_source_completion_words_get_icon (GtkSourceCompletionProvider *self)
{
return GTK_SOURCE_COMPLETION_WORDS (self)->priv->icon;
@@ -123,19 +123,19 @@ population_finished (GtkSourceCompletionWords *words)
g_source_remove (words->priv->idle_id);
words->priv->idle_id = 0;
}
-
+
g_free (words->priv->word);
words->priv->word = NULL;
-
+
if (words->priv->context != NULL)
{
if (words->priv->cancel_id)
{
- g_signal_handler_disconnect (words->priv->context,
+ g_signal_handler_disconnect (words->priv->context,
words->priv->cancel_id);
words->priv->cancel_id = 0;
}
-
+
g_object_unref (words->priv->context);
words->priv->context = NULL;
}
@@ -147,21 +147,21 @@ add_in_idle (GtkSourceCompletionWords *words)
guint idx = 0;
GList *ret = NULL;
gboolean finished;
-
+
if (words->priv->populate_iter == NULL)
{
- words->priv->populate_iter =
+ words->priv->populate_iter =
gtk_source_completion_words_library_find_first (words->priv->library,
words->priv->word,
words->priv->word_len);
}
- while (idx < words->priv->proposals_batch_size &&
+ while (idx < words->priv->proposals_batch_size &&
words->priv->populate_iter)
{
- GtkSourceCompletionWordsProposal *proposal =
+ GtkSourceCompletionWordsProposal *proposal =
gtk_source_completion_words_library_get_proposal (words->priv->populate_iter);
-
+
/* Only add non-exact matches */
if (strcmp (gtk_source_completion_words_proposal_get_word (proposal),
words->priv->word) != 0)
@@ -169,16 +169,16 @@ add_in_idle (GtkSourceCompletionWords *words)
ret = g_list_prepend (ret, proposal);
}
- words->priv->populate_iter =
+ words->priv->populate_iter =
gtk_source_completion_words_library_find_next (words->priv->populate_iter,
words->priv->word,
words->priv->word_len);
++idx;
}
-
+
ret = g_list_reverse (ret);
finished = words->priv->populate_iter == NULL;
-
+
gtk_source_completion_context_add_proposals (words->priv->context,
GTK_SOURCE_COMPLETION_PROVIDER (words),
ret,
@@ -196,7 +196,7 @@ add_in_idle (GtkSourceCompletionWords *words)
}
static gboolean
-valid_word_char (gunichar ch,
+valid_word_char (gunichar ch,
gpointer data)
{
return g_unichar_isprint (ch) && (ch == '_' || g_unichar_isalnum (ch));
@@ -216,13 +216,13 @@ get_word_at_iter (GtkTextIter *iter,
gpointer data)
{
GtkTextIter end = *iter;
-
+
if (!gtk_source_completion_words_utils_forward_word_end (iter, valid, data) ||
!gtk_text_iter_equal (iter, &end))
{
return NULL;
}
-
+
if (!gtk_source_completion_words_utils_backward_word_start (iter,
valid,
valid_start,
@@ -230,7 +230,7 @@ get_word_at_iter (GtkTextIter *iter,
{
return NULL;
}
-
+
if (gtk_text_iter_equal (iter, &end))
{
return NULL;
@@ -280,7 +280,7 @@ gtk_source_completion_words_populate (GtkSourceCompletionProvider *provider,
return;
}
- words->priv->cancel_id =
+ words->priv->cancel_id =
g_signal_connect_swapped (context,
"cancelled",
G_CALLBACK (population_finished),
@@ -290,12 +290,12 @@ gtk_source_completion_words_populate (GtkSourceCompletionProvider *provider,
words->priv->word = word;
words->priv->word_len = strlen (word);
-
+
buf = GET_WORDS_BUFFER (buffer);
gtk_text_buffer_move_mark (buffer,
gtk_source_completion_words_buffer_get_mark (buf),
&iter);
-
+
/* Do first right now */
if (add_in_idle (words))
{
@@ -340,7 +340,7 @@ static void
update_buffers_batch_size (GtkSourceCompletionWords *words)
{
GList *item;
-
+
for (item = words->priv->buffers; item; item = g_list_next (item))
{
BufferBinding *binding = (BufferBinding *)item->data;
@@ -353,7 +353,7 @@ static void
update_buffers_minimum_word_size (GtkSourceCompletionWords *words)
{
GList *item;
-
+
for (item = words->priv->buffers; item; item = g_list_next (item))
{
BufferBinding *binding = (BufferBinding *)item->data;
@@ -369,13 +369,13 @@ gtk_source_completion_words_set_property (GObject *object,
GParamSpec *pspec)
{
GtkSourceCompletionWords *self = GTK_SOURCE_COMPLETION_WORDS (object);
-
+
switch (prop_id)
{
case PROP_NAME:
g_free (self->priv->name);
self->priv->name = g_value_dup_string (value);
-
+
if (self->priv->name == NULL)
{
self->priv->name = g_strdup (_("Document Words"));
@@ -386,7 +386,7 @@ gtk_source_completion_words_set_property (GObject *object,
{
g_object_unref (self->priv->icon);
}
-
+
self->priv->icon = g_value_dup_object (value);
break;
case PROP_PROPOSALS_BATCH_SIZE:
@@ -419,7 +419,7 @@ gtk_source_completion_words_get_property (GObject *object,
GParamSpec *pspec)
{
GtkSourceCompletionWords *self = GTK_SOURCE_COMPLETION_WORDS (object);
-
+
switch (prop_id)
{
case PROP_NAME:
@@ -449,7 +449,7 @@ gtk_source_completion_words_get_property (GObject *object,
}
}
-static void
+static void
gtk_source_completion_words_class_init (GtkSourceCompletionWordsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -458,7 +458,7 @@ gtk_source_completion_words_class_init (GtkSourceCompletionWordsClass *klass)
object_class->set_property = gtk_source_completion_words_set_property;
object_class->get_property = gtk_source_completion_words_get_property;
-
+
g_object_class_install_property (object_class,
PROP_NAME,
g_param_spec_string ("name",
@@ -466,7 +466,7 @@ gtk_source_completion_words_class_init (GtkSourceCompletionWordsClass *klass)
_("The provider name"),
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
+
g_object_class_install_property (object_class,
PROP_ICON,
g_param_spec_object ("icon",
@@ -494,7 +494,7 @@ gtk_source_completion_words_class_init (GtkSourceCompletionWordsClass *klass)
G_MAXUINT,
50,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
+
g_object_class_install_property (object_class,
PROP_MINIMUM_WORD_SIZE,
g_param_spec_uint ("minimum-word-size",
@@ -537,12 +537,12 @@ gtk_source_completion_words_get_start_iter (GtkSourceCompletionProvider *provide
GtkTextBuffer *buffer;
GtkSourceCompletionWordsBuffer *buf;
GtkTextIter it;
-
+
gtk_source_completion_context_get_iter (context, &it);
-
+
buffer = gtk_text_iter_get_buffer (&it);
buf = GET_WORDS_BUFFER (buffer);
-
+
gtk_text_buffer_get_iter_at_mark (buffer,
iter,
gtk_source_completion_words_buffer_get_mark (buf));
@@ -575,11 +575,11 @@ gtk_source_completion_words_iface_init (GtkSourceCompletionProviderIface *iface)
iface->get_priority = gtk_source_completion_words_get_priority;
}
-static void
+static void
gtk_source_completion_words_init (GtkSourceCompletionWords *self)
-{
+{
self->priv = GTK_SOURCE_COMPLETION_WORDS_GET_PRIVATE (self);
-
+
self->priv->library = gtk_source_completion_words_library_new ();
}
@@ -594,16 +594,16 @@ GtkSourceCompletionWords *
gtk_source_completion_words_new (const gchar *name,
GdkPixbuf *icon)
{
- return g_object_new (GTK_SOURCE_TYPE_COMPLETION_WORDS,
- "name", name,
- "icon", icon,
+ return g_object_new (GTK_SOURCE_TYPE_COMPLETION_WORDS,
+ "name", name,
+ "icon", icon,
NULL);
}
static void
buffer_destroyed (BufferBinding *binding)
{
- binding->words->priv->buffers = g_list_remove (binding->words->priv->buffers,
+ binding->words->priv->buffers = g_list_remove (binding->words->priv->buffers,
binding);
g_object_unref (binding->buffer);
g_slice_free (BufferBinding, binding);
@@ -625,33 +625,33 @@ gtk_source_completion_words_register (GtkSourceCompletionWords *words,
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS (words));
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
-
+
binding = g_object_get_data (G_OBJECT (buffer), BUFFER_KEY);
-
+
if (binding != NULL)
{
return;
}
-
+
buf = gtk_source_completion_words_buffer_new (words->priv->library,
buffer);
-
+
gtk_source_completion_words_buffer_set_scan_batch_size (buf,
words->priv->scan_batch_size);
gtk_source_completion_words_buffer_set_minimum_word_size (buf,
words->priv->minimum_word_size);
-
+
binding = g_slice_new (BufferBinding);
binding->words = words;
binding->buffer = buf;
-
- g_object_set_data_full (G_OBJECT (buffer),
- BUFFER_KEY,
+
+ g_object_set_data_full (G_OBJECT (buffer),
+ BUFFER_KEY,
binding,
(GDestroyNotify)buffer_destroyed);
- words->priv->buffers = g_list_prepend (words->priv->buffers,
+ words->priv->buffers = g_list_prepend (words->priv->buffers,
binding);
}
@@ -668,7 +668,7 @@ gtk_source_completion_words_unregister (GtkSourceCompletionWords *words,
{
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS (words));
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
-
+
g_object_set_data (G_OBJECT (buffer), BUFFER_KEY, NULL);
}
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwords.h
b/gtksourceview/completion-providers/words/gtksourcecompletionwords.h
index b9ba487..8421f72 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwords.h
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwords.h
@@ -40,7 +40,7 @@ typedef struct _GtkSourceCompletionWordsPrivate
GtkSourceCompletionWordsPrivate
struct _GtkSourceCompletionWords {
GObject parent;
-
+
GtkSourceCompletionWordsPrivate *priv;
};
@@ -53,7 +53,7 @@ GType gtk_source_completion_words_get_type (void) G_GNUC_CONST;
GtkSourceCompletionWords *
gtk_source_completion_words_new (const gchar *name,
GdkPixbuf *icon);
-
+
void gtk_source_completion_words_register (GtkSourceCompletionWords *words,
GtkTextBuffer *buffer);
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.h
b/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.h
index 8088e6a..c70f82b 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.h
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwordsbuffer.h
@@ -43,7 +43,7 @@ typedef struct _GtkSourceCompletionWordsBufferPrivate GtkSourceCompletionWordsB
struct _GtkSourceCompletionWordsBuffer {
GObject parent;
-
+
GtkSourceCompletionWordsBufferPrivate *priv;
};
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwordslibrary.c
b/gtksourceview/completion-providers/words/gtksourcecompletionwordslibrary.c
index f1a0004..34157a6 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwordslibrary.c
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwordslibrary.c
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
- *
+ *
* gtksourceview is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
@@ -52,7 +52,7 @@ static void
gtk_source_completion_words_library_class_init (GtkSourceCompletionWordsLibraryClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
+
object_class->finalize = gtk_source_completion_words_library_finalize;
signals[LOCK] =
@@ -60,20 +60,20 @@ gtk_source_completion_words_library_class_init (GtkSourceCompletionWordsLibraryC
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
- NULL,
NULL,
- g_cclosure_marshal_VOID__VOID,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
-
+
signals[UNLOCK] =
g_signal_new ("unlock",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
- NULL,
NULL,
- g_cclosure_marshal_VOID__VOID,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
@@ -84,7 +84,7 @@ static void
gtk_source_completion_words_library_init (GtkSourceCompletionWordsLibrary *self)
{
self->priv = GTK_SOURCE_COMPLETION_WORDS_LIBRARY_GET_PRIVATE (self);
-
+
self->priv->store = g_sequence_new ((GDestroyNotify)g_object_unref);
}
@@ -108,9 +108,9 @@ compare_items (GtkSourceCompletionWordsProposal *a,
GtkSourceCompletionWordsProposal *b,
const gchar *word)
{
- const gchar *m1 =
+ const gchar *m1 =
gtk_source_completion_words_proposal_get_word (a == NULL ? b : a);
-
+
return strcmp (m1, word);
}
@@ -120,11 +120,11 @@ iter_match_prefix (GSequenceIter *iter,
gint len)
{
GtkSourceCompletionWordsProposal *item;
-
+
item = gtk_source_completion_words_library_get_proposal (iter);
-
+
return strncmp (gtk_source_completion_words_proposal_get_word (item),
- word,
+ word,
len != -1 ? len : strlen (word)) == 0;
}
@@ -135,7 +135,7 @@ gtk_source_completion_words_library_get_proposal (GSequenceIter *iter)
{
return NULL;
}
-
+
return GTK_SOURCE_COMPLETION_WORDS_PROPOSAL (g_sequence_get (iter));
}
@@ -146,7 +146,7 @@ gtk_source_completion_words_library_find_first (GtkSourceCompletionWordsLibrary
{
GSequenceIter *iter;
GSequenceIter *prev;
-
+
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_LIBRARY (library), NULL);
g_return_val_if_fail (word != NULL, NULL);
@@ -159,45 +159,45 @@ gtk_source_completion_words_library_find_first (GtkSourceCompletionWordsLibrary
{
return NULL;
}
-
+
if (len == -1)
{
len = strlen (word);
}
-
+
/* Test if this position might be after the last match */
- if (!g_sequence_iter_is_begin (iter) &&
- (g_sequence_iter_is_end (iter) ||
+ if (!g_sequence_iter_is_begin (iter) &&
+ (g_sequence_iter_is_end (iter) ||
!iter_match_prefix (iter, word, len)))
{
iter = g_sequence_iter_prev (iter);
-
+
/* Maybe there is actually nothing in the sequence */
- if (g_sequence_iter_is_end (iter) ||
+ if (g_sequence_iter_is_end (iter) ||
!iter_match_prefix (iter, word, len))
{
return NULL;
}
}
-
+
if (g_sequence_iter_is_end (iter))
{
return NULL;
}
-
+
/* Go back while it matches */
while (iter &&
- (prev = g_sequence_iter_prev (iter)) &&
+ (prev = g_sequence_iter_prev (iter)) &&
iter_match_prefix (prev, word, len))
{
iter = prev;
-
+
if (g_sequence_iter_is_begin (iter))
{
break;
}
}
-
+
return iter;
}
@@ -227,26 +227,26 @@ gtk_source_completion_words_library_find (GtkSourceCompletionWordsLibrary *libr
GtkSourceCompletionWordsProposal *other;
const gchar *word = gtk_source_completion_words_proposal_get_word (proposal);
gint len = strlen (word);
-
+
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_LIBRARY (library), NULL);
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_PROPOSAL (proposal), NULL);
-
+
iter = gtk_source_completion_words_library_find_first (library, word, len);
-
+
if (!iter)
{
return NULL;
}
-
+
do
{
other = gtk_source_completion_words_library_get_proposal (iter);
-
+
if (proposal == other)
{
return iter;
}
-
+
iter = g_sequence_iter_next (iter);
} while (!g_sequence_iter_is_end (iter) &&
strcmp (gtk_source_completion_words_proposal_get_word (other),
@@ -259,9 +259,9 @@ static void
on_proposal_unused (GtkSourceCompletionWordsProposal *proposal,
GtkSourceCompletionWordsLibrary *library)
{
- GSequenceIter *iter = gtk_source_completion_words_library_find (library,
+ GSequenceIter *iter = gtk_source_completion_words_library_find (library,
proposal);
-
+
if (iter != NULL)
{
g_sequence_remove (iter);
@@ -274,17 +274,17 @@ gtk_source_completion_words_library_add_word (GtkSourceCompletionWordsLibrary *l
{
GtkSourceCompletionWordsProposal *proposal;
GSequenceIter *iter;
-
+
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_LIBRARY (library), NULL);
g_return_val_if_fail (word != NULL, NULL);
-
+
/* Check if word already exists */
iter = gtk_source_completion_words_library_find_first (library, word, -1);
-
+
if (iter)
{
proposal = gtk_source_completion_words_library_get_proposal (iter);
-
+
if (strcmp (gtk_source_completion_words_proposal_get_word (proposal),
word) == 0)
{
@@ -293,19 +293,19 @@ gtk_source_completion_words_library_add_word (GtkSourceCompletionWordsLibrary *l
return proposal;
}
}
-
+
if (library->priv->locked)
{
return NULL;
}
proposal = gtk_source_completion_words_proposal_new (word);
-
+
g_signal_connect (proposal,
"unused",
G_CALLBACK (on_proposal_unused),
library);
-
+
/* Insert proposal into binary tree of words */
g_sequence_insert_sorted (library->priv->store,
proposal,
@@ -318,7 +318,7 @@ gtk_source_completion_words_library_add_word (GtkSourceCompletionWordsLibrary *l
void
gtk_source_completion_words_library_remove_word (GtkSourceCompletionWordsLibrary *library,
GtkSourceCompletionWordsProposal *proposal)
-{
+{
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_LIBRARY (library));
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_PROPOSAL (proposal));
@@ -329,7 +329,7 @@ void
gtk_source_completion_words_library_lock (GtkSourceCompletionWordsLibrary *library)
{
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_LIBRARY (library));
-
+
library->priv->locked = TRUE;
g_signal_emit (library, signals[LOCK], 0);
}
@@ -338,7 +338,7 @@ void
gtk_source_completion_words_library_unlock (GtkSourceCompletionWordsLibrary *library)
{
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_LIBRARY (library));
-
+
library->priv->locked = FALSE;
g_signal_emit (library, signals[UNLOCK], 0);
}
@@ -347,6 +347,6 @@ gboolean
gtk_source_completion_words_library_is_locked (GtkSourceCompletionWordsLibrary *library)
{
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_LIBRARY (library), TRUE);
-
+
return library->priv->locked;
}
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwordsproposal.c
b/gtksourceview/completion-providers/words/gtksourcecompletionwordsproposal.c
index e0b3b33..70bee87 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwordsproposal.c
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwordsproposal.c
@@ -39,8 +39,8 @@ static guint signals[NUM_SIGNALS] = {0,};
static void gtk_source_completion_proposal_iface_init (gpointer g_iface, gpointer iface_data);
-G_DEFINE_TYPE_WITH_CODE (GtkSourceCompletionWordsProposal,
- gtk_source_completion_words_proposal,
+G_DEFINE_TYPE_WITH_CODE (GtkSourceCompletionWordsProposal,
+ gtk_source_completion_words_proposal,
G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GTK_SOURCE_TYPE_COMPLETION_PROPOSAL,
gtk_source_completion_proposal_iface_init))
@@ -52,21 +52,21 @@ gtk_source_completion_words_proposal_get_text (GtkSourceCompletionProposal *prop
}
static void
-gtk_source_completion_proposal_iface_init (gpointer g_iface,
+gtk_source_completion_proposal_iface_init (gpointer g_iface,
gpointer iface_data)
{
GtkSourceCompletionProposalIface *iface = (GtkSourceCompletionProposalIface *)g_iface;
-
+
/* Interface data getter implementations */
iface->get_label = gtk_source_completion_words_proposal_get_text;
iface->get_text = gtk_source_completion_words_proposal_get_text;
}
-
+
static void
gtk_source_completion_words_proposal_finalize (GObject *object)
{
GtkSourceCompletionWordsProposal *proposal;
-
+
proposal = GTK_SOURCE_COMPLETION_WORDS_PROPOSAL (object);
g_free (proposal->priv->word);
@@ -77,7 +77,7 @@ static void
gtk_source_completion_words_proposal_class_init (GtkSourceCompletionWordsProposalClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
+
object_class->finalize = gtk_source_completion_words_proposal_finalize;
signals[UNUSED] =
@@ -85,9 +85,9 @@ gtk_source_completion_words_proposal_class_init (GtkSourceCompletionWordsProposa
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
- NULL,
NULL,
- g_cclosure_marshal_VOID__VOID,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
@@ -98,7 +98,7 @@ static void
gtk_source_completion_words_proposal_init (GtkSourceCompletionWordsProposal *self)
{
self->priv = GTK_SOURCE_COMPLETION_WORDS_PROPOSAL_GET_PRIVATE (self);
-
+
self->priv->use_count = 1;
}
@@ -107,7 +107,7 @@ gtk_source_completion_words_proposal_new (const gchar *word)
{
GtkSourceCompletionWordsProposal *proposal =
g_object_new (GTK_SOURCE_TYPE_COMPLETION_WORDS_PROPOSAL, NULL);
-
+
proposal->priv->word = g_strdup (word);
return proposal;
}
@@ -116,7 +116,7 @@ void
gtk_source_completion_words_proposal_use (GtkSourceCompletionWordsProposal *proposal)
{
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_PROPOSAL (proposal));
-
+
g_atomic_int_inc (&proposal->priv->use_count);
}
@@ -124,7 +124,7 @@ void
gtk_source_completion_words_proposal_unuse (GtkSourceCompletionWordsProposal *proposal)
{
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_WORDS_PROPOSAL (proposal));
-
+
if (g_atomic_int_dec_and_test (&proposal->priv->use_count))
{
g_signal_emit (proposal, signals[UNUSED], 0);
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwordsproposal.h
b/gtksourceview/completion-providers/words/gtksourcecompletionwordsproposal.h
index 81d00da..5ed0fc4 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwordsproposal.h
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwordsproposal.h
@@ -41,7 +41,7 @@ typedef struct _GtkSourceCompletionWordsProposalPrivate
GtkSourceCompletionWord
struct _GtkSourceCompletionWordsProposal {
GObject parent;
-
+
GtkSourceCompletionWordsProposalPrivate *priv;
};
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwordsutils.c
b/gtksourceview/completion-providers/words/gtksourcecompletionwordsutils.c
index 68137eb..5695008 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwordsutils.c
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwordsutils.c
@@ -28,7 +28,7 @@ gtk_source_completion_words_utils_backward_word_start (GtkTextIter *iter,
gpointer data)
{
GtkTextIter prev = *iter;
-
+
/* Go backward as long as there are word characters */
while (TRUE)
{
@@ -37,23 +37,23 @@ gtk_source_completion_words_utils_backward_word_start (GtkTextIter *iter,
{
break;
}
-
+
gtk_text_iter_backward_char (&prev);
-
+
/* Check if the previous character is a valid word character */
if (!valid (gtk_text_iter_get_char (&prev), data))
{
break;
}
-
+
*iter = prev;
}
-
+
if (!valid (gtk_text_iter_get_char (iter), data))
{
return FALSE;
}
-
+
/* Go forward with while !valid_start */
return valid_start (gtk_text_iter_get_char (iter), data);
}
@@ -71,15 +71,15 @@ gtk_source_completion_words_utils_forward_word_end (GtkTextIter *iter,
{
break;
}
-
+
/* Check if the next character is a valid word character */
if (!valid (gtk_text_iter_get_char (iter), data))
{
break;
}
-
+
gtk_text_iter_forward_char (iter);
}
-
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]