Typing two spaces after sentence-ending punctuation inserts a mistaken period (full stop)
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:/
Related branches
- system-apps-ci-bot: Needs Fixing (continuous-integration)
- Ubuntu Phablet Team: Pending requested
-
Diff: 153 lines (+43/-6)5 files modifiedplugins/chewing/src/chewinglanguagefeatures.cpp (+1/-1)
plugins/pinyin/src/chineselanguagefeatures.cpp (+1/-1)
plugins/westernsupport/westernlanguagefeatures.cpp (+1/-1)
src/view/abstracttexteditor.cpp (+29/-2)
tests/unittests/ut_editor/ut_editor.cpp (+11/-1)
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 |
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 |
Changed in canonical-devices-system-image: | |
status: | Fix Committed → Fix Released |
I think the way to fix this is something like:
sentence_ ending_ punctuation = ['.', '!', '?', '…']
When someone types two spaces in a row {
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 punctuation contains none of the characters from sentence_ ending_ punctuation {
if (auto punctuation is turned on) {
if trailing_
replace the last space with a period
}
}
}