GNOME Bugzilla – Bug 650829
Spell Checker does not select/highlight the first spelling error
Last modified: 2019-03-23 20:54:17 UTC
1. the specific steps or actions you took that caused you to encounter the problem, i activated the Gedit spelling checker by clicking Tools/Check Spelling 2. the behavior you expected, and i expected the spelling errors detected by Check Spelling to be highlighted one at a time 3. the behavior you actually encountered (in as much detail as possible). The first error detected by Check Spelling was not highlighted in the document. All subsequent errors were correctly highlighted. Chazbo Note: This bug was initially filed in Ubuntu Launchpad as bug # 645695
Reproduced in gedit 3.3.5 - see https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/645695/comments/11
Created attachment 234565 [details] screenshot of catching the first spelling error in gedit 3.7.3
Created attachment 234566 [details] catching the first spelling error in 3.6.2
I do not experience this issue in gedit 3.6.2 or 3.7.3 (built via jhbuild).
Works for me too. Feel free to reopen the bug if you still encounter the bug.
Created attachment 292724 [details] First screenshot showing the bug First attachment relating to 12/14/2014 comment by ccb This shows the first spelling error, where the misspelled word is Not highlighted (the line on which the misspelled word resides is selected).
Created attachment 292725 [details] Second screen showing subsequent spelling errors correctly hilighted Second Screenshot related to comment on 12/14/2014
This bug is still present in Gedit 3.10.4, running under Ubuntu 14.04
Now I better understand with the screenshots, and I can reproduce the bug with the latest gedit. (In reply to comment #6) > This shows the first spelling error, where the misspelled word is Not > highlighted To "highlight" a misspelled word, the plugin actually _selects_ the word. > (the line on which the misspelled word resides is selected). The bug also occurs when there is no selection before launching the spell checker dialog window. What you meant is probably that the misspelled word is on the current line (where the cursor is), and the current line is _highlighted_ (not selected).
Created attachment 293014 [details] [review] Spell check first mispelled word selection First mispelled word was not selected because the focus was stolen by the "Check spelling" dialog. Changed get_next_misspelled_word signature to get the word start and end Selected the word after showing the dialog
Review of attachment 293014 [details] [review]: ::: plugins/spell/gedit-spell-plugin.c @@ +518,3 @@ range->mw_end = end; + *w_start = start; + *w_end = end; you also must set *w_start and *w_end to -1 in the else part of the test @@ +544,3 @@ { gchar *word = NULL; + gint start, end; i prefer to be more explicit and use start_offset and end_offset @@ +769,3 @@ GtkWidget *dlg; GtkTextIter start, end; + gint w_start, w_end; and to be consistent so start_offset and end_offset too here @@ +846,3 @@ gtk_widget_show (dlg); + + GtkTextIter s, e; use start_iter and end_iter @@ +853,3 @@ + gtk_text_buffer_select_range (GTK_TEXT_BUFFER (doc), &s, &e); + + gedit_view_scroll_to_cursor (view); but you must remove these two lines from the get_next_misspelled_word function to not select words twice
Created attachment 293040 [details] [review] Spell plugin - first mispelled word selection First mispelled word was not selected because the focus was stolen by the "Check spelling" dialog. Changed get_next_misspelled_word signature to get the word start and end Selected the word after showing the dialog
Created attachment 293054 [details] [review] gedit spell plugin: select first mispelled word commited as ffbaed1