porcupine
porcupine copied to clipboard
ctrl+shift+t
in a web browser if I accidentally close a tab, I can quickly reopen it with Ctrl+Shift+t
, in Porcupine I can't :(
We could use tab.get_state()
to do this. See restart and poppingtabs plugins for examples.
For accidental closes, remembering one (or two, or three) most recently closed tab is probably enough. I don't like the idea of maintaining a list of states of closed tabs, because a list like that would grow and grow if you keep Porcupine opened for a long time, potentially consuming a lot of memory.
We could remember the full state of a handful (configurable?) and then just remember the path (and maybe cursor position?) of a bunch more, I presume hundreds or thousands with no impact.
50 at most, and maybe save it to disk?
the path (and maybe cursor position?)
Tabs already have get_state()
and from_state()
methods that are meant to be used for exactly this. They are currently used in the restart plugin to restore previously opened tabs after restarting Porcupine.