Bug 518338 - Double click does not recognize return character as word boundary in selecting text.
Summary: Double click does not recognize return character as word boundary in selectin...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (other bugs)
Version First Reported In: 5.3.0
Platform: Microsoft Windows Microsoft Windows
: NOR minor
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-30 16:56 UTC by Victor Wren
Modified: 2026-04-23 08:49 UTC (History)
0 users

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


Attachments
Screenshot showing result of double-clicking first word in paragraph. (49.65 KB, image/jpeg)
2026-03-30 16:56 UTC, Victor Wren
Details
Second Experiment showing inconsistent behavior of spaces and returns in selection boundaries. (100.84 KB, image/jpeg)
2026-03-30 17:19 UTC, Victor Wren
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Wren 2026-03-30 16:56:44 UTC
Created attachment 191145 [details]
Screenshot showing result of double-clicking first word in paragraph.

SUMMARY
When selecting text, double click is grabbing too much, i.e. it is extending the selection through the return character to the adjacent word.

STEPS TO REPRODUCE
1.  Create a text box. Write some text. Terminate with a return character and write some more text.
2. Double click on either the last word of the first paragraph, or the first word of the second paragraph.

OBSERVED RESULT
The selection will extend through the return character to the next (or previous) word in the adjoining paragraph, leaving both words selected after a double-click, indicating that the selection does not see the return character as being equivalent to other non-word characters like space in defining the boundaries of the word.

EXPECTED RESULT
Selection should be bounded by return character the same as it would be by a space character, allowing selection of the first or last word of a paragraph by double-clicking without sucking in the last or first word of the adjacent paragraph.

SOFTWARE/OS VERSIONS
Windows: 10

ADDITIONAL INFORMATION
This affects non-rectangular text containers exactly the same.
Comment 1 Victor Wren 2026-03-30 17:19:04 UTC
Created attachment 191148 [details]
Second Experiment showing inconsistent behavior of spaces and returns in selection boundaries.
Comment 2 Victor Wren 2026-03-30 17:20:41 UTC
Further experimentation shows additional odd behaviour:
When paragraphs are separated by two return characters, boundary of words is recognized.
If spaces are placed between two return characters, boundary of words is NOT recognized.
Comment 3 wolthera 2026-04-23 08:44:42 UTC
Git commit 7f1454ca276c51bd4883a0859ca9244b0c9f4505 by Wolthera van Hövell tot Westerflier.
Committed on 23/04/2026 at 08:43.
Pushed by woltherav into branch 'master'.

Fix word selection when there's hard breaks present.

Hard breaks get hidden by default, which is why they sometimes don't have
a cursor pos, so we try to search for them better.

M  +30   -0    libs/flake/text/KoSvgTextShape.cpp

https://invent.kde.org/graphics/krita/-/commit/7f1454ca276c51bd4883a0859ca9244b0c9f4505
Comment 4 wolthera 2026-04-23 08:49:49 UTC
Git commit 5250c9e36339dfc0c21881ca4b681850323db3d6 by Wolthera van Hövell.
Committed on 23/04/2026 at 08:49.
Pushed by woltherav into branch 'krita/6.0'.

Fix word selection when there's hard breaks present.

Hard breaks get hidden by default, which is why they sometimes don't have
a cursor pos, so we try to search for them better.


(cherry picked from commit 7f1454ca276c51bd4883a0859ca9244b0c9f4505)

Co-authored-by: Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>

M  +30   -0    libs/flake/text/KoSvgTextShape.cpp

https://invent.kde.org/graphics/krita/-/commit/5250c9e36339dfc0c21881ca4b681850323db3d6