Bug 478204 - Auto-formatting of text produces unexpected and unwanted results
Summary: Auto-formatting of text produces unexpected and unwanted results
Status: CONFIRMED
Alias: None
Product: ghostwriter
Classification: Applications
Component: general (show other bugs)
Version: 23.08.3
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: megan.conkle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-07 11:04 UTC by Riccardo Robecchi
Modified: 2024-07-07 01:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Riccardo Robecchi 2023-12-07 11:04:47 UTC
SUMMARY
Trying to insert formatting before typing new text inside an already-existing paragraph seems to be broken, as the formatting is applied to the text which was already typed instead of to the text which is about to be typed.

STEPS TO REPRODUCE
1. Type a paragraph
2. Go back in the paragraph with the caret
3. Add a space after a word
4. Press the shortcut to e.g. make text italic

OBSERVED RESULT
The previous word, i.e. the one before the space you just typed, becomes italic.

EXPECTED RESULT
The asterisks to make the text italic are applied after the space, as if you were writing with no following text. The previous word is not touched at all.

SOFTWARE/OS VERSIONS
Linux: KDE neon
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
It is not quite clear why typing something new inside an already-existing paragraph should make formatting behave differently from formatting where no text follows. If you type without any text after the caret the behaviour is as expected (i.e., formatting applies to what you are going to type and not what you have already typed), so this shouldn't really change based on where the cursor is. This is also the behaviour of every single other editor which supports formatting that I have ever used, so I would say it is reasonable to expect editors to behave this way.
It should also be noted that typing three or more spaces (so, having a total of four spaces between one word and the next) makes the formatting work as expected, which makes the behaviour even more jarring.