Bug 492869

Summary: multiselection: odd behaviour when joining selections
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: Sven Brauch <mail>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: waqar.17a
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Sven Brauch 2024-09-09 09:26:37 UTC
To reproduce, make any selection, then make another selection (with Alt) outside that selection which ends where the cursor is.

The cursor will disappear, but typing will type every character twice now.
Comment 1 Waqar Ahmed 2024-09-09 13:05:52 UTC
Git commit 5be86bab29d56def43ed34e7a9ef3fa0ef72cab3 by Waqar Ahmed.
Committed on 09/09/2024 at 13:05.
Pushed by waqar into branch 'master'.

Fix merging of selections in opposite directions

No unit test as these selections can only be done with mouse

M  +20   -9    src/view/kateviewinternal.cpp

https://invent.kde.org/frameworks/ktexteditor/-/commit/5be86bab29d56def43ed34e7a9ef3fa0ef72cab3
Comment 2 Waqar Ahmed 2024-09-09 13:06:00 UTC
Git commit c5d89b91dc2da4ed0d9b8e7c27c84b748da5ab72 by Waqar Ahmed.
Committed on 09/09/2024 at 13:05.
Pushed by waqar into branch 'master'.

Fix secondary cursor at boundary of selection doesn't get removed

M  +3    -0    src/view/kateviewinternal.cpp

https://invent.kde.org/frameworks/ktexteditor/-/commit/c5d89b91dc2da4ed0d9b8e7c27c84b748da5ab72
Comment 3 Waqar Ahmed 2024-09-09 13:17:26 UTC
For selections to join, they must overlap. This behaviour is consistent with vscode and sublime.

However, the cursor disappearing is definitely an issue.
Comment 4 Bug Janitor Service 2024-09-09 15:40:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/722
Comment 5 Waqar Ahmed 2024-09-13 06:31:49 UTC
Git commit 49e3eb49ca632cecc099f434e96182375fdf0279 by Waqar Ahmed.
Committed on 13/09/2024 at 06:31.
Pushed by waqar into branch 'master'.

Fix text insertion with multiple cursors at same position.

We can have 2 cursors at the same positions when there are two selections
that start/end at the same position. In such a case cursor positions are same
but selections are different. Thus text insertion needs to be handled
differntly. I have tried to match the behaviour of sublime/vscode for this.

M  +29   -0    autotests/src/multicursortest.cpp
M  +1    -0    autotests/src/multicursortest.h
M  +24   -5    src/document/katedocument.cpp
M  +11   -1    src/render/katerenderer.cpp
M  +4    -4    src/view/kateview.cpp
M  +6    -1    src/view/kateview.h

https://invent.kde.org/frameworks/ktexteditor/-/commit/49e3eb49ca632cecc099f434e96182375fdf0279