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

revert filetype detect, save localoptions #180

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

zwhitchcox
Copy link
Contributor

See #179 (comment)

Save local options which will restore syntax highlighting, as well as wrap and number options

@rmagatti rmagatti merged commit 609c952 into rmagatti:main Nov 9, 2022
@MikaelElkiaer
Copy link

@rmagatti @zwhitchcox

I'd call this a breaking change, took me some time figuring out why my session switching was breaking.
Had to :e the first file every time I switched sessions, and in general just had weird behaviour.

@rmagatti Perhaps you could create a pinned issue with breaking changes like these? - For easy subscription.

@rmagatti
Copy link
Owner

I can create that issue for sure! I'm still unclear on what was breaking from this change as merely the defer function was removed that didn't actually even exist before if I'm not mistaken. Either way a breaking change issue is a great idea, thanks!

@rmagatti
Copy link
Owner

@MikaelElkiaer here it is:
#186

@MikaelElkiaer
Copy link

I can create that issue for sure! I'm still unclear on what was breaking from this change as merely the defer function was removed that didn't actually even exist before if I'm not mistaken. Either way a breaking change issue is a great idea, thanks!

There might be more to it then than just this.

My syntax highlighting was gone whenever I would restore a session, until after adding the localoptions bit to restore options.

@zwhitchcox
Copy link
Contributor Author

@MikaelElkiaer Sorry this gave you so much trouble, but I would not classify this as a breaking change. auto-session was just covering up a misconfiguration (not saving localoptions) with an ugly hack where it would delay the restoration of the session by 50 ms.

Aside from the race condition bugs this could cause, it also introduced a scenario where if the session restoration caused the directory to change, this would cause a new session restoration, which could cause the directory to change again, ad infinitum.

The syntax highlighting is a lower priority than the infinitely recursive directory changes.

That being said, I do think we could make it easier to figure out than combing through issues/PRs. It might be nice to add the localoptions note to the trouble shooting page on the wiki @rmagatti ...or maybe just add it as a note in the readme?

I could also just add this change back in, because it would not hurt anything other than slightly decreasing performance, but it might provide a better UX for some users.

@MikaelElkiaer
Copy link

@zwhitchcox I am not trying to make a big thing out of this. I am just saying this: ugly hack or not, once that was removed, highlights did not work immediately after session load.

I don't think you should re-add it, but perhaps it ought to be mentioned in #186 (I guess I just did), in case others stumble upon it.

Great work on the localoptions solution though, works like a charm. :)

@rmagatti
Copy link
Owner

The readme does recommend adding localoptions to sessioniptions already. It just doesn't really say what that does or doesn't do. Maybe this is a common enough occurrence that it might be worth explaining further in the readme, but maybe it's easier to tell people to :h sessionoptions in case they want to know what each of the recommended options (and others) do for session loading. I'll add something to the readme on this (unless one of you want to 😄)

@zwhitchcox
Copy link
Contributor Author

How about we just say if more people comments on this saying that it gave them trouble we can add more documentation, but otherwise count this as documentation

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 this pull request may close these issues.

3 participants