Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring the session does not restore the current file or files order when tabs_order_beside is enabled #3609

Closed
b4n opened this issue Oct 17, 2023 · 3 comments · Fixed by #3611
Assignees
Milestone

Comments

@b4n
Copy link
Member

b4n commented Oct 17, 2023

Restoring the session (from my upgraded ~/.config, which has seen all versions since the dawn of time^W^W^W^W I started using Geany) restores the files, but not:

  • the order
  • the current file

It kinda looks like the first element is right, but the reset is sort of loaded in reverse… Might have something to do with the option on where new tabs are opened?

@b4n b4n added this to the 2.0 milestone Oct 17, 2023
@b4n
Copy link
Member Author

b4n commented Oct 17, 2023

Yeah, it happens if Preferences → Interface → Notebook tabs → Editor tabs → Next to current is checked.

b4n added a commit to b4n/geany that referenced this issue Oct 17, 2023
When the `tab_order_beside` option is enabled, tabs are opened on
either side of the active tab, depending on `tab_order_ltr`, rather
than at either end.

However, when loading startup files we don't switch to the last opened
document right away, but postpone this to the very end.  This affects
the order tabs are loaded, as the active one is always the first one at
this stage.

Rather than over-complicating the loading order to compensate the
various options' effect, temporarily revert to an set of options that
is easy to handle, and restore it after loading is finished.  This also
simplifies the existing logic as a basic forward iteration is now
enough.

Fixes geany#3609.
@b4n
Copy link
Member Author

b4n commented Oct 17, 2023

hum… it's bad, but I'm wondering for how long this existed. I didn't bisect, but quickly going through this code seems to suggest it's nothing recent (yet, I might be wrong).

@b4n b4n self-assigned this Oct 17, 2023
@b4n b4n changed the title Restoring the session does not restore the current file or files order Restoring the session does not restore the current file or files order when tabs_order_beside is enabled Oct 17, 2023
@elextr
Copy link
Member

elextr commented Oct 18, 2023

Given that it is done in notebook_new_tab() which all file creates use I would guess its been happening since that option was added by fdd451f (note see the "by" author name :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants