Typing two spaces after sentence-ending punctuation inserts a mistaken period (full stop)

Bug #1579083 reported by Matthew Paul Thomas
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Medium
Bill Filler
ubuntu-keyboard (Ubuntu)
Fix Released
Medium
Michael Sheldon

Bug Description

0. In System Settings, ensure that “Language & Text” > “Auto punctuation” is turned on.
1. Focus any normal text field. For example, create a new note in Notes.
2. Type “Hello” then press Space twice.
3. Type “Hello.” then press Space twice.
4. Type “Hello!” then press Space twice.
5. Type “Hello?” then press Space twice.
6. Type “Hello…” then press Space twice.
7. Type “The usual greeting (Hello)” then press Space twice.
8. Type “The usual greeting. (Hello.)” then press Space twice.

What happens:
2,3,4,5,6,7,8. An extra period is inserted.

What should happen:
2. An extra period is inserted.
3. An extra period is NOT inserted.
4. An extra period is NOT inserted.
5. An extra period is NOT inserted.
6. An extra period is NOT inserted.
7. An extra period is inserted.
8. An extra period is NOT inserted.

Problem occurs with: Ubuntu 15.04 r323
Does not occur with: iOS 9.3.1 (except cases 6 and 8), Android 6.0.1 (except case 8)

Bug 1540373 is the equivalent for the TLD key (.com etc).

[Originally reported by Bob Summerwill on the ubuntu-phone@ mailing list. <https://lists.launchpad.net/ubuntu-phone/msg20236.html>]

Related branches

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

I think the way to fix this is something like:

sentence_ending_punctuation = ['.', '!', '?', '…']

When someone types two spaces in a row {
    if (auto punctuation is turned on) {
        last_letter_position = the position of the last character in Unicode’s “Letter” category
        trailing_punctuation = the string between the last_letter_position and the first space
        if trailing_punctuation contains none of the characters from sentence_ending_punctuation {
            replace the last space with a period
        }
    }
}

Changed in ubuntu-keyboard (Ubuntu):
status: New → Confirmed
assignee: nobody → Michael Sheldon (michael-sheldon)
Changed in ubuntu-keyboard (Ubuntu):
status: Confirmed → Fix Committed
Changed in ubuntu-keyboard (Ubuntu):
status: Fix Committed → Confirmed
Bill Filler (bfiller)
Changed in ubuntu-keyboard (Ubuntu):
importance: Undecided → Medium
Changed in canonical-devices-system-image:
assignee: nobody → Bill Filler (bfiller)
milestone: none → 12
importance: Undecided → Medium
status: New → Confirmed
Changed in canonical-devices-system-image:
milestone: 12 → 13
Changed in canonical-devices-system-image:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-keyboard - 0.100+16.10.20160818-0ubuntu1

---------------
ubuntu-keyboard (0.100+16.10.20160818-0ubuntu1) yakkety; urgency=medium

  * Make ubuntu-keyboard depend on ubuntu-keyboard-english as it's used
    as a fallback when other plugins are unavailable (LP: #1606512)
  * Add missing qml-module-qtmultimedia dependency (LP: #1594822)
  * Improve double space punctuation insertion behaviour (LP: #1579083)
  * Make flake8 usage compatible with flake8 3.x
  * Add optional dependency on fonts-noto

 -- Michael Sheldon <email address hidden> Thu, 18 Aug 2016 13:53:57 +0000

Changed in ubuntu-keyboard (Ubuntu):
status: Confirmed → Fix Released
Changed in canonical-devices-system-image:
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.