[gedit] Skip no-spell-check ranges at the start of the doc
- From: Paolo Borelli <pborelli src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Skip no-spell-check ranges at the start of the doc
- Date: Thu, 7 Jan 2010 14:06:28 +0000 (UTC)
commit 521286069c7a39c014803227db2851f46d841948
Author: Paolo Borelli <pborelli gnome org>
Date: Thu Jan 7 15:03:40 2010 +0100
Skip no-spell-check ranges at the start of the doc
plugins/spell/gedit-spell-plugin.c | 39 ++++++++++++++++++++++-------------
1 files changed, 24 insertions(+), 15 deletions(-)
---
diff --git a/plugins/spell/gedit-spell-plugin.c b/plugins/spell/gedit-spell-plugin.c
index f6bdbd2..1faf3b3 100644
--- a/plugins/spell/gedit-spell-plugin.c
+++ b/plugins/spell/gedit-spell-plugin.c
@@ -311,28 +311,37 @@ set_check_range (GeditDocument *doc,
(GDestroyNotify)g_free);
}
- gtk_text_buffer_move_mark (GTK_TEXT_BUFFER (doc),
- range->start_mark,
- start);
-
- if (!gtk_text_iter_inside_word (end))
- {
- /* if we're neither inside a word,
- * we must be in some spaces.
- * skip backward to the end of the previous word. */
- if (!gtk_text_iter_is_end (end))
+ if (gedit_spell_utils_skip_no_spell_check (start, end))
+ {
+ if (!gtk_text_iter_inside_word (end))
{
- gtk_text_iter_backward_word_start (end);
- gtk_text_iter_forward_word_end (end);
+ /* if we're neither inside a word,
+ * we must be in some spaces.
+ * skip backward to the end of the previous word. */
+ if (!gtk_text_iter_is_end (end))
+ {
+ gtk_text_iter_backward_word_start (end);
+ gtk_text_iter_forward_word_end (end);
+ }
+ }
+ else
+ {
+ if (!gtk_text_iter_ends_word (end))
+ gtk_text_iter_forward_word_end (end);
}
}
else
{
- if (!gtk_text_iter_ends_word (end))
- gtk_text_iter_forward_word_end (end);
+ /* no spell checking in the specified range */
+ start = end;
}
- gtk_text_buffer_move_mark (GTK_TEXT_BUFFER (doc), range->end_mark, end);
+ gtk_text_buffer_move_mark (GTK_TEXT_BUFFER (doc),
+ range->start_mark,
+ start);
+ gtk_text_buffer_move_mark (GTK_TEXT_BUFFER (doc),
+ range->end_mark,
+ end);
range->mw_start = -1;
range->mw_end = -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]