Created attachment 187844 [details] Video showing delete option not working when Kwrite is launched directly, and the delete working when 'empty' launched & opening a file SUMMARY When opening a file in Kwrite - For example by double clicking a file in Dolphin, or via console, the Files > File Actions > Delete, option will not work. STEPS TO REPRODUCE 1. Have a test .txt file 2. Open the file in Kwrite 3. Files > File Actions > Delete Alternative: 1. Open console 2. Open a file with Kwrite and a file path, eg "kwrite <path>" 3. Files > File Actions > Delete OBSERVED RESULT The window is closed, but the file is not deleted EXPECTED RESULT The file is deleted SOFTWARE/OS VERSIONS Operating System: Fedora Linux 43 KDE Plasma Version: 6.5.4 KDE Frameworks Version: 6.21.0 Qt Version: 6.10.1 Kernel Version: 6.17.12-300.fc43.x86_64 (64-bit) Graphics Platform: Wayland Processors: 16 × Intel® Core™ i9-9900K CPU @ 3.60GHz Memory: 32 GiB of RAM (31.1 GiB usable) Graphics Processor: AMD Radeon RX 6800 KWrite Version 25.12.0 Also able to reproduce on another device running Arch ADDITIONAL INFORMATION If you Open Kwrite with no file, then manually open a file, the same Files > File Actions > Delete works as expected Using the "Rename" in the File Actions works as expected I have experienced this with .json as well as .txt I have showed a video of this bug, as well as the empty launch & open where it does delete as expected. (The large "Delete file" dialog is due to a window rule for position / size and unrelated)
I have found if opening multiple files with a multiselect so they open in one window with tabs, the Files > File Actions > Delete will work for all tabs - except for the last one where the window is closed.
The issue is that the code (like for rename) closes the document, that then leads to closing of KWrite (or Kate) if configured that way.
Git commit 637cbd48d4ee12613f8e0f5eec3f0ee477117832 by Christoph Cullmann. Committed on 21/12/2025 at 16:46. Pushed by cullmann into branch 'master'. fix delete of last file open in editor only try to close the file, if we use closeDocument, we might close the application and never delete stuff M +7 -1 apps/lib/katefileactions.cpp https://invent.kde.org/utilities/kate/-/commit/637cbd48d4ee12613f8e0f5eec3f0ee477117832
rename did already use closeUrl and should be fine.
Thanks for reporting this.