[gedit] spell plugin: simplify the code
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] spell plugin: simplify the code
- Date: Fri, 19 Dec 2014 16:22:52 +0000 (UTC)
commit 5b3ff199c053be6dfc63134a30078492d8373bd8
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Dec 19 17:12:48 2014 +0100
spell plugin: simplify the code
And move the debug message at the right place.
plugins/spell/gedit-spell-plugin.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/plugins/spell/gedit-spell-plugin.c b/plugins/spell/gedit-spell-plugin.c
index 8915f0c..cfd83b3 100644
--- a/plugins/spell/gedit-spell-plugin.c
+++ b/plugins/spell/gedit-spell-plugin.c
@@ -518,8 +518,6 @@ get_next_misspelled_word (GeditView *view,
range->mw_end = end;
*word_start_offset = start;
*word_end_offset = end;
-
- gedit_debug_message (DEBUG_PLUGINS, "Select [%d, %d]", start, end);
}
else
{
@@ -537,15 +535,17 @@ select_misspelled_word (GeditView *view,
gint word_start_offset,
gint word_end_offset)
{
- GeditDocument *doc;
- GtkTextIter word_start_iter, word_end_iter;
+ GtkTextBuffer *buffer;
+ GtkTextIter word_start_iter;
+ GtkTextIter word_end_iter;
- doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)));
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
- gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (doc), &word_start_iter, word_start_offset);
- gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (doc), &word_end_iter, word_end_offset);
+ gtk_text_buffer_get_iter_at_offset (buffer, &word_start_iter, word_start_offset);
+ gtk_text_buffer_get_iter_at_offset (buffer, &word_end_iter, word_end_offset);
- gtk_text_buffer_select_range (GTK_TEXT_BUFFER (doc), &word_start_iter, &word_end_iter);
+ gedit_debug_message (DEBUG_PLUGINS, "Select [%d, %d]", word_start_offset, word_end_offset);
+ gtk_text_buffer_select_range (buffer, &word_start_iter, &word_end_iter);
gedit_view_scroll_to_cursor (view);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]