I asked in https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/559#note_940928 an question that inspired me to put up this feature request. I mostly just want to remember this idea, so that I or somebody else could perhaps try implement this some day. Looking at my `sessionrc` I see that an `[Working File Sets][code_9925939][View 0 Config]` doesn't store any information about of its order, at least explicitly. The `[Working File Sets][code_9925939]` list of view's seems to be sorted in lexical order: ``` View 0=file:///mnt/source/kde/src/kdevelop/kdevplatform/debugger/breakpoint/breakpointmodel.h View 1=file:///mnt/source/kde/src/kdevelop/kdevplatform/debugger/breakpoint/breakpointmodel.cpp View 10=file:///mnt/source/kde/src/kdevelop/kdevplatform/sublime/tooldocument.cpp View 11=file:///mnt/source/kde/src/kdevelop/kdevplatform/sublime/idealbuttonbarwidget.cpp ``` So I'm assuming once a document tab/view is closed, it's removed from these structures, and therefore, I think KDevelop is unable to remember the tab/view ordering of any closed documents. Reordering of the document tabs while they remain open works fine, and this order is persistent. However, KDevelop seems to forget this ordering as soon as the document tab/view is closed. The default re-opened position of a tab/view thus feels wrong most of the time, and the available configuration settings don't help much. So my proposed idea would be to save an ordering hints per URL, to enable `openDocument()` to restore an opened document tab/view at its former position, or at least nearish to it. This would take preference over the current configuration settings "Open new tab after current" and "Arrange related document side by side" when the ordering hint is available. * Option in the configuration UI: "Remember closed tab order" opt-in. * Closing a document would save/update its tab/view order as an hint for the next time this URL is opened. * If the URL's file on disk ceases to exist, the kdevelop could then clean up any tab/view order hints of such URLs. (to not bloat the config indefinitely) Or alternatively, remember only last N closed tab/view positions.
Managing tab order is difficult and time-consuming. Do you manually arange tabs in your preferred order? My tabs usually end up in quite a mess of an order, because I tend to go on document-opening spree by Ctrl+clicking identifiers often. Then I have to close all files from time to time to prevent severe IDE slowdown. I generally use Quick Open or Ctrl+Tab rather than the tab bar to switch between documents faster.
(In reply to Igor Kushnir from comment #1) > Do you manually arange tabs in your preferred order? My tabs usually end up in quite a mess of an > order, because I tend to go on document-opening spree by Ctrl+clicking > identifiers often. Then I have to close all files from time to time to > prevent severe IDE slowdown. I generally use Quick Open or Ctrl+Tab rather > than the tab bar to switch between documents faster. Yes, and after "document opening spree" (usually because of debugging, or trying to find a definition) I have to re-arrange or close most of the tabs. The reorganizing becomes nearly impossible after 20 or so tabs, because the tabs keep opening at "wrong places". Thus, I keep only 6 or so documents manually arranged, and when KDevelop decides to insert new tabs in between those, it becomes annoying. Ctrl-clicking isn't always helpful either, and some times I get dubious results. So it's easier to just keep the correct document open, and switch between them.
(In reply to JATothrim from comment #2) > Thus, I keep only 6 or so documents > manually arranged, and when KDevelop decides to insert new tabs in between > those, it becomes annoying. Then maybe you should make use of working sets (the button in the top right corner, near the area switch button). First Stash those 6 documents in a working set. Then Add All to reopen them. At this point you'll have a current working set and an identical backup working set. After you open many unwanted documents, just Close All documents and Add All from the backup working set. You can also back up [Working File Sets] config entries from sessionrc and restore them manually.