gedit doesn't handle apostrophes correctly when spell-checking

Bug #36227 reported by Mark Florian
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Fix Released
gedit (Ubuntu)
Fix Released
Declined for Lucid by Sebastien Bacher

Bug Description

Open gedit, type in "wouldn't" without the quotes, and either enable Autocheck
spelling (Tools menu) or use Check Spelling to open the dialogue. Gedit suggests
replacing the "wouldn" part with "wouldn't", which is performed, would yield
"wouldn't't". Also works with "doesn't", "couldn't", "shouldn't" etc. and
anything where the contracted form adds letters to the original word, i.e.
"should not" becomes "shouldn't". Obviously "shouldn" isn't a word... but you
know what I'm getting at :) Apostrophes seem to be considered as the end of a
word, like whitespace.

$ dpkg -l | grep gedit
ii gedit 2.12.0-0ubuntu1 light-weight text editor
ii gedit-common 2.12.0-0ubuntu1 light-weight text editor support files

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for your bug. It's known upstream:

Changed in gedit:
status: Unconfirmed → Confirmed
Changed in gedit:
status: Confirmed → In Progress
Changed in gedit:
assignee: seb128 → desktop-bugs
Changed in gedit:
importance: Medium → Low
Changed in gedit:
status: Confirmed → Triaged
Revision history for this message
Jeff Campbell (jeff-soupbowl) wrote :

I have been able to reproduce this in Lucid Beta 1

Changed in gedit:
importance: Unknown → High
Revision history for this message
Fred Stephens (fjs205) wrote :

ridiculous this hasn't been fixed in years! very annoying.

Revision history for this message
Oly HDN (nodiktat) wrote :

Same Bug in French too, but really annoying, cause French got a lot of this kind of words, like qu'elle, qu'un, aujourd'hui....

Revision history for this message
John Baptist (jepst79) wrote :

I confirm this is still a problem in Precise Beta 2.

If this can't be fixed, then the auto-spell-check feature should probably be removed.

Revision history for this message
Mateo Salta (mateo-salta) wrote :

Same 12.04 LTS, I looked over the source code and found that sections of "gedit-spell-checker" reference that it was modified from "gtkspell 2.0.2".
At references in a later version:

"version 2.0.11 (2005-05-27):
 * Re-enable apostrophe word-breaking workarounds (GNOME bug #97545).
 * Additional translations (see po/ChangeLog)."

This seems that they have found a fix for gtkspell and may help to solve the problem in "gedit-spell-checker"

The relevent part of the code is:

static gboolean
gtkspell_text_iter_forward_word_end(GtkTextIter *i) {
 GtkTextIter iter;

/* heuristic:
 * if we're on an singlequote/apostrophe and
 * if the next letter is alphanumeric,
 * this is an apostrophe. */

 if (!gtk_text_iter_forward_word_end(i))
  return FALSE;

 if (gtk_text_iter_get_char(i) != '\'')
  return TRUE;

 iter = *i;
 if (gtk_text_iter_forward_char(&iter)) {
  if (g_unichar_isalpha(gtk_text_iter_get_char(&iter))) {
   return (gtk_text_iter_forward_word_end(i));

 return TRUE;


Which it looks like someone has already adapted into a workaround here

Looks like It may have been abandoned, since the fix existed since 2004, and the bug since around 2002,

10 years later...

Changed in gedit:
importance: High → Medium
status: In Progress → Confirmed
Changed in gedit (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
Changed in gedit:
status: Confirmed → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

That should be fixed in gedit 3.20 so probably next cycle in ubuntu

Changed in gedit (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Paul White (paulw2u) wrote :

Upstream bug closed "RESOLVED FIXED" on 2016-03-05
Checked ok Ubuntu 18.04 and gedit 3.28.1
Marking "Fix Released" to close

Changed in gedit (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.