Spyder: Add shortcut to open last closed tab

Created on 7 May 2015  路  16Comments  路  Source: spyder-ide/spyder

Ok, I'm being a bit spoiled with this feature request and Spyder is already insanely awesome.

It would be nice to have a keyboard shortcut to re-open the last tab(s) you just closed. This would be like Firefox or Chromium where you just hit CTL+SHIFT+T a couple times when you mistakenly close some tabs.

Editor Completed Enhancement

All 16 comments

@ccordoba12 @goanpeca I would like to work on this!

Yayy!

@thewhitetulip cool, need some pointers? @Garrett-R, how far in the history you had in mind? I guess the limit will be the same as we currently store in the last opened files?

What I have in mind is that there will be a function which is triggered when we click the close button, I can get the tab object and store it somewhere, maybe a sqlite file or a plain file and then open a new tab with the same file name, that way we can open the tab even after spyder is closed and opened again. I don't know where to start though

@goanpeca, good question. Maybe imitate Firefox? The default limit seems to be 10 tabs. I'd guess it would be very rare for someone to need the 11th closed tab.

I also think the history can be flushed between sessions as in Firefox.

we can keep unlimited last closed tabs as well :D

pull request: https://github.com/spyder-ide/spyder/pull/2610 should fix this issue.

The thing with this implementation is that the maximum number of recent files is going to be the value set for that by the spyder.ini file, which is 20 for default. History isn't flushed between sessions.

@mariacamilaremolinagutierrez, please rebase PR #2611 in top of 3.x and finish the work of @thewhitetulip :-)

@ccordoba12 I already did the rebase in top of 3.x after cloning @thewhitetulip 's spyder fork. However I am not sure how to update the PR because I don't have permissions on his repo. I can't push onto it so that the PR is updated. Also, his PR is like this:

image

So we'll need to change master and replace it with 3.x

@mariacamilaremolinagutierrez just take his work and recreate it on a new PR made by you. That is the easiest ;-)

@mariacamilaremolinagutierrez, as @goanpeca said, after rebasing please keep commiting to the same branch (i.e. last_open_tab) and when you're done, just push that branch to your fork, and then create a PR with it :-)

@goanpeca @ccordoba12 Awesome, I just did that then, I didn't know I could push other people branches to my repos, that's so cool!

Yep, that's great!! I've done that several times already ;-)

:-)

If you need write access to my repo I'd be happy to give you :-)

Don't worry @thewhitetulip, she already solved the problem :-)

Was this page helpful?
0 / 5 - 0 ratings