Bug 450144

Summary: Ctrl+C sometimes does not copy text from the git blame popup
Product: [Applications] kate Reporter: Kishore Gopalakrishnan <kishore96>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph, nate
Priority: NOR    
Version First Reported In: 21.12.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 23.04
Sentry Crash Report:

Description Kishore Gopalakrishnan 2022-02-13 11:00:02 UTC
SUMMARY
When the git blame plugin is enabled, you can trigger a popup on a particular line that shows the commit in which it was last modified. Ctrl+C does not work (except for the first time) to copy text from this popup. However, the 'copy' option in the context menu still works.

STEPS TO REPRODUCE
1. In Settings > Configure Kate > Plugins, enable 'Git blame'.
2. In Settings > Configure Kate > Editing > General, disable 'Copy/cut the current line if invoked without any text selected'
3. Open a text file in any git repo
4. Place the cursor in any line of the file
5. Click on the 'git blame' comment that appears on the right of that line
6. In the popup that appears, use the mouse to highlight some text
7. Press Ctrl+C
8. Use the mouse to highlight some other text in the same popup
9. Press Ctrl+C

OBSERVED RESULTS
The highlighted text is not copied to the clipboard the second time (and Ctrl+C will not work in such popups until you relaunch Kate)

EXPECTED RESULTS
Ctrl+C should always copy the highlighted text.

SOFTWARE VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.24.0
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.8-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Memory: 21.5 GiB of RAM
Graphics Processor: AMD Radeon Vega 8 Graphics

ADDITIONAL INFORMATION
'Right-click > Copy' and the X11 clipboard (the one that is used for middle-click paste) still work reliably. Only the Ctrl+C keyboard shortcut is affected.

If you have enabled Settings > Configure Kate > Editing > General > 'Copy/cut the current line if invoked without any text selected', Kate will instead copy the line outside the popup on which cursor has been placed (and not the line you have selected inside the popup).

Also reproducible on KDE Neon Unstable.
Comment 1 Nate Graham 2022-04-07 14:56:06 UTC
Can reproduce.
Comment 2 Christoph Cullmann 2023-02-26 20:26:54 UTC
Would that be fixed if we use some widget local shortcut instead of the eventfilter?
Comment 3 Waqar Ahmed 2023-02-27 08:40:21 UTC
Git commit aff5d6e1ee6b3f8624c6fe7c4e82122a8d7703e3 by Waqar Ahmed.
Committed on 27/02/2023 at 08:39.
Pushed by waqar into branch 'master'.

blame: Fix m_view not cleared when hiding tooltip

We remove the event filter but don't clear the view so the next time
when the tooltip shows, there is no event filter on it.
FIXED-IN: 23.04

M  +1    -0    addons/git-blame/gitblametooltip.cpp

https://invent.kde.org/utilities/kate/commit/aff5d6e1ee6b3f8624c6fe7c4e82122a8d7703e3
Comment 4 Waqar Ahmed 2023-02-28 13:08:57 UTC
Git commit e427d895dfa76d97344c7bd270e53de6e37f42ad by Waqar Ahmed.
Committed on 28/02/2023 at 13:07.
Pushed by waqar into branch 'release/22.12'.

blame: Fix m_view not cleared when hiding tooltip

We remove the event filter but don't clear the view so the next time
when the tooltip shows, there is no event filter on it.
FIXED-IN: 23.04

M  +1    -0    addons/git-blame/gitblametooltip.cpp

https://invent.kde.org/utilities/kate/commit/e427d895dfa76d97344c7bd270e53de6e37f42ad