Bug 332344 - KMail Composing with apostrophes cursor jumps all over
Summary: KMail Composing with apostrophes cursor jumps all over
Alias: None
Product: kmail2
Classification: Unclassified
Component: composer (show other bugs)
Version: 4.12.3
Platform: Archlinux Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kdepim bugs
Depends on:
Reported: 2014-03-20 01:35 UTC by Craig
Modified: 2014-04-03 06:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.13


Note You need to log in before you can comment on or make changes to this bug.
Description Craig 2014-03-20 01:35:24 UTC
When composing emails with KMail 4.12.3 (this goes back at least 6 months) having very frustrating issues with the current cursor position going every which way when an apostrophe is involved in the substance of it being 's or 're etc. ' on its own does not seem to have any issues.

When writing as normal and I type ANY word that ends with 's or 're (may be others) the cursor skips down to the next line, I really cannot make any sense of what's happening but it is extremely frustrating having to constantly move my cursor. My best guess would be something related to auto-correct. Additionally, it does not just happen in the case of above, if I go back in my email to add something (so there are words/text to either side of the cursor) and start typing and again, type anything that ends with 's or 're (etc) the cursor will start skipping over words and butchering whatever sentence I was attempting to write haha. 

Here is an example of the first item described above, just typing a new email and typing a word that ends with 's and continue to type so you see what happens:
	This is a test of my email’s

The cursor jumped to the next line after typing email's ('s being the part that causes the jump).

The second issue above can be demonstrated with the below, original sentence:
"Also when going back in sentence (will add apos. To ‘sentences’ ) and adding a apos. And continuing to type it jumps words ahead of the cursor causing issues."

Then I go back and ADD 's to sentence then CONTINUE TO TYPE (from that position) the following: "and i'll keep adding stuff here" see the end result below, also note that i'll does not seem to experience this issue for example in i'll as above; it seems "and I'll" is fine but then after hitting space at that point it skips a word ahead:

"Also when going back in sentence’s  and i’ll(will  keep adding stuff here add apos. To ‘sentences’ ) and adding a apos. And continuing to type it jumps words ahead of the cursor causing issues."

Reproducible: Always

Steps to Reproduce:
1. Start New Message (or reply)
2. Type something similar to my first example above (Hi,<enter-tab>This is a test of my email's capability/bug.)
3. Cursor skips to new line after email's

Also see second example where happens when typing in middle of text/reply/email where it skips words, can see steps to reproduce above.
Actual Results:  
Hi, This is a test of my email's
(and second example)

Expected Results:  
Hi, This is a test of my email's capability/bug.
(and second example)

I have no idea what is causing this but is driving me and others within my company quite literally up the wall unless we consciously avoid all punctuation at least with apostrophes which is a pain its in own. This happens every single time when the word ends in 's and I believe 're 't /etc however it is also worth noting for whatever reason after experiencing it, for example doing the above, then going back and trying again it seems to be fine, but whenever I reply/new email and type as nomal this happens a LOT but again not always for whatever reason? Hopefully you guys have some idea to the cause so I can disable it, here are my settings that may be related (anything else let me know):
Rich text/html emails always (not sure of plain-text), 
Not using templates/custom templates
AutoCorrection is AMERICAN ENGLISH
Convert first letter of a sentence... YES
Convert two uppercase characters to one... YES
Suppress double spaces YES
Capitalize name of days YES
Autoformat URLs... YES
Custom Quotes: Replace double quotes/replace single quotes YES
      Add non-breaking space before specific punctuation marks in French text YES (this sounds like could be related moreso than others but not in french????)
Advanced Autocorrection YES (but do not have any at this time)
Exceptions NO - None

Hopefully you guys have some ideas, thanks!
Comment 1 Craig 2014-03-21 17:16:08 UTC
Confirmed this occurs only in relation to the Auto-correct setting "Replace single quotes with typographical quotes" ON/enabled, disabling this setting resolves the issue but when dealing with Mac users a lot they send weird quote marks which can cause some issues so enjoyed the auto-replacement, however can live without for now as not too big of a deal, still some kind of issue that causes the auto-correct to replace the quote and then jump your cursor if you're typing. Thanks,

PS - it does also happen with 're and others.
Comment 2 Laurent Montel 2014-03-22 18:10:46 UTC
Ok I will investigate it.
Comment 3 Craig 2014-03-22 19:26:10 UTC
Thank you Laurent, let me know I'd you need any further information, disabling that setting for the time being has resolved the issue for me but of course still an issue. Also worth noting I do have a signature which starts with an HR and auto input signature/put above quote is enabled and if there is no blank line below where I'm typing (ie I'm typing and signature horizontal line is on the next line) it does not seem to experience #1 above, it would seem it only enters a line break as described above if there is an empty line below the cursor/typing position. Thanks again and let me know if any further information or debugging is needed.
Comment 4 Laurent Montel 2014-04-03 06:49:42 UTC
Git commit 42b8ad52eb0934beb05a53efa712c90fb3508114 by Montel Laurent.
Committed on 03/04/2014 at 06:49.
Pushed by mlaurent into branch 'KDE/4.13'.

Fix Bug 332344 - KMail Composing with apostrophes cursor jumps all over

FIXED-IN: 4.13

M  +10   -5    messagecomposer/composer/kmeditor.cpp
M  +4    -1    pimcommon/autocorrection/autocorrection.cpp
M  +1    -1    pimcommon/autocorrection/autocorrection.h
M  +8    -3    pimcommon/autocorrection/tests/autocorrection_gui.cpp
M  +6    -2    pimcommon/autocorrection/widgets/lineeditwithautocorrection.cpp
M  +10   -5    pimcommon/autocorrection/widgets/richtexteditwithautocorrection.cpp