I have data that’s I’d like to associate with a “session.”
If the window has a project, I’d want to associate the data with the window.
If the window doesn’t have a project, I’d want to associate the data with each (relevant) view in a window.
By “session” I mean that this stuff that relates to the plugin while it’s running. This isn’t, for example, stuff that I’d ever expect or want users to enter in, say, a settings file. And it’s stuff that I can re-create as needed.
My question is: can I use window.settings()
and view.settings()
for this?
If the answer is “no” then it means that I’ll have data associated with open windows and open views, and I’ll have to take responsibility for keeping things in sync — e.g., unloading the data when the associated window (or view) closes.
That’s doable, but if I add the data to settings then Sublime does it for me. Not just that: Sublime is sure to get it right. Me getting it right relies on having a very solid understanding of the various events. As a plugin newbie, well, I’m not there yet.
(The session data I’m talking about is dicts of lists of strings that are used for completions.)
I don’t expect the data to be big, though that’s clearly subjective.
And I would store it in memory regardless.
This is all coming up because I don’t want to store it in memory longer than it’s actually needed. Which is what I’m doing right now.