Bug 485738

Summary: Kate crashes when deleting the file that is the only one opened in split view
Product: [Applications] kate Reporter: Andrew Shark <ashark>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version First Reported In: 24.02.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Andrew Shark 2024-04-18 14:23:04 UTC
STEPS TO REPRODUCE
1. Create two files in home directory: 1.txt and 2.txt
2. Open 1.txt in Kate, Open 2.txt in Kate.
3. Click View | Split View | Split Vertical
4. Close 2.txt in the left view.
So now you have the only tab in left view which is 1.txt, and the only tab in right view with 2.txt.
5. In the right view, right click on the 2.txt tab, and choose "Delete".
6. It asks "Do you really want to delete...?", answer Yes.

OBSERVED RESULT
Kate crashes

EXPECTED RESULT
Kate should not crash. As there are no more tabs opened in right split view, it should be either closed, or a placeholder should be shown there.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Graphics Platform: Wayland
Comment 1 Waqar Ahmed 2024-04-18 15:04:17 UTC
Git commit fa9cd5b098875ff8d0a844d2161eeb54064fa75b by Waqar Ahmed.
Committed on 18/04/2024 at 14:40.
Pushed by waqar into branch 'master'.

Fix crash on deleting the only file in view

M  +4    -1    apps/lib/kateviewspace.cpp

https://invent.kde.org/utilities/kate/-/commit/fa9cd5b098875ff8d0a844d2161eeb54064fa75b