Bug 470000 - Kate properly restore the session (including untitled)
Summary: Kate properly restore the session (including untitled)
Status: RESOLVED DUPLICATE of bug 464224
Alias: None
Product: kate
Classification: Applications
Component: sessions (show other bugs)
Version: 23.04.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-19 14:23 UTC by Andras Soltesz
Modified: 2023-11-17 08:18 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Soltesz 2023-05-19 14:23:51 UTC
SUMMARY
I am using Sessions in Kate 23.04 and use the automatic restoration of the last used session.

I have the "Automatically save and restore" setting for both "Newly-created unsaved files" and "Files with unsaved changes" switched on.

This allows restoring pre-existing (named) files that were opened from the file system, modified but the changes not yet saved when Kate gets closed. When I restart Kate, these files get auto-restored with all of the unsaved changes and are displayed in tabs (great improvement BTW, huge thanks Kate devs).

However, untitled (newly-created) files are not restored to their tabs. I can till recover them by using the Quick Open function but I would like to see them properly restored on their original tabs when I (re)start Kate.

Reason:
I use these untitled editors as notepads for different temporary content types and I would like to see them without any searching/recovering when Kate gets restarted.

I am using Notepad++ on my Windows work laptop and this is the default behavior there (I would like to have the same behavior on my Linux boxes too).

STEPS TO REPRODUCE
0.  Ensure the configuration described in the summary
1.  Create and save a Session in Kate
2.  Create a new editor (Unnamed 1) and put some content in it
3.  Close and reopen Kate

OBSERVED RESULT

The "Untitled" editor is not restored on its tab.

Instead, I get an "Untitled (2)" tab with no content in it.

Note: The editor content can still be recovered via the Quick Open function but this is not what most people would expect. (e.g.: coming from Sublime or Notepad++) 

EXPECTED RESULT

The "Untitled" editor is restored to its own tab when Kate starts just like all of the other files/editors which are part of the Session. 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version:  5.27.4
KDE Frameworks Version: .5.105.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION

My report is very similar to #462112 but it doesn't work as intended when closing Kate with the window control "x" either (while #462112 states that it works for him/her in that case).

#463008 and #468573 look very similar too, they may have the same root cause as this.

Nevertheless these are probably duplicates.
Comment 1 Andras Soltesz 2023-05-19 14:26:36 UTC
Workaround:

Currently, I create a set of saved editors for these kinds of generic notepads in Kate.
This allows them to be properly restored when Kate gets restarted.
Comment 2 Waqar Ahmed 2023-11-17 08:18:31 UTC

*** This bug has been marked as a duplicate of bug 464224 ***