Bug 415644

Summary: Previously selected text can be deleted by editing another line of the file
Product: [Applications] kdevelop Reporter: meyraud705
Component: All editorsAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: major    
Priority: NOR    
Version: 5.4.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Deselect text when moving cursor

Description meyraud705 2019-12-28 14:38:26 UTC
When moving to another line by clicking on a warning in the build tool view, any previously selected text is not deselected.

STEPS TO REPRODUCE
1. Open a source file that contains warning or error
2. Select some text in this file
3. Build
4. Click on a warning in build tool view: cursor move to the position of the warning
5. Press 'del' key or any key that produces a character: text selected at step 2 is deleted

Note that the selected text and the warning must be in the same file.

Linux/KDE Plasma: Kubuntu 19.10
KDE Plasma Version: KDE plasma 5.17.4
KDE Frameworks Version: 5.65
Qt Version: 5.12.14
Comment 1 meyraud705 2020-02-01 13:24:27 UTC
Created attachment 125587 [details]
Deselect text when moving cursor

I attached a patch that fixes this issue. I am not familiar with this project so I am not sure it is the correct way to fix this but it works.
Comment 2 Christoph Feck 2020-02-01 14:08:26 UTC
Thank you for looking at the issue! KDevelop developers use a gitlab instance to allow contributors to submit merge requests at https://invent.kde.org/kde/kdevelop
Comment 3 Milian Wolff 2020-02-14 10:23:56 UTC
funny how noone noticed this until now

I'll apply a patch based on yours now, thanks!
Comment 4 Milian Wolff 2020-02-14 10:32:18 UTC
Git commit f8754f08ac096100b5160940a0003ad4d52c2a57 by Milian Wolff.
Committed on 14/02/2020 at 10:31.
Pushed by mwolff into branch '5.5'.

Clear selection when updating cursor position

Normally the user cannot get distinct selections and cursor
positions either using the mouse or keyboard. So we shouldn't
get into that position either when programatically changing
the cursor position.

M  +2    -4    kdevplatform/shell/textdocument.cpp

https://invent.kde.org/kde/kdevelop/commit/f8754f08ac096100b5160940a0003ad4d52c2a57