Bug 454924 - Closing last file in VI-mode always exists Kate
Summary: Closing last file in VI-mode always exists Kate
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: Vi Input Mode (show other bugs)
Version: Git
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-06 07:40 UTC by Alexander Lohnau
Modified: 2022-06-28 10:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: Frameworks 5.96
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Lohnau 2022-06-06 07:40:01 UTC
In case one closes the last tab in the VI-mode using the vi-commands, Kate quits. But when pressing Ctrl+w to close the last tab, Kate stays open as expected. This is due to the vi command parser in KTextEditor directly calling the `quit` method on the Kate app.

Also, in the sessions we have an option "Close the application entirely when last file is closed". The expected behavior is that the vi-mode also follows this setting.

I am already working on making the patches, but wonder if we need to have a way to quit the application entirely using the vi-commands.
Comment 1 Bug Janitor Service 2022-06-06 08:23:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/758
Comment 2 Bug Janitor Service 2022-06-06 08:29:04 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/380
Comment 3 Christoph Cullmann 2022-06-26 14:25:38 UTC
Git commit e8f055a3ba907419fd3fd51f529e1555b6da129a by Christoph Cullmann, on behalf of Alexander Lohnau.
Committed on 24/06/2022 at 13:00.
Pushed by cullmann into branch 'master'.

KateApp: Respect modCloseAfterLast setting when closing document

M  +11   -2    apps/lib/kateapp.h

https://invent.kde.org/utilities/kate/commit/e8f055a3ba907419fd3fd51f529e1555b6da129a
Comment 4 Christoph Cullmann 2022-06-28 10:20:59 UTC
Git commit ade545081b5b5b24ccfbdce8b4b02840a6cfc146 by Christoph Cullmann, on behalf of Alexander Lohnau.
Committed on 28/06/2022 at 09:16.
Pushed by alex into branch 'master'.

AppCommands: Do not quit application when last document or all documents are closed

This needs https://invent.kde.org/utilities/kate/-/merge_requests/758 in order to fix the bug.
Without it, we would simply ignore the "Close the application entirely when last file is closed"
setting if it is set to true. Though that is not mission-critical and IMHO less of a problem than the bug this commit fixes.

M  +13   -6    src/vimode/appcommands.cpp
M  +1    -0    src/vimode/appcommands.h

https://invent.kde.org/frameworks/ktexteditor/commit/ade545081b5b5b24ccfbdce8b4b02840a6cfc146