Author Topic: New plugin: reopen last closed editor(s)  (Read 9419 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
New plugin: reopen last closed editor(s)
« on: December 23, 2010, 06:19:58 pm »
There is something really annoying, that happens from time to time (much to often of course):
I accidently close an editor tab and have to search allover the disk or through a large project/workspace to reopen it.

Firefox/Iceweasel has a great feture, that stores the last closed editors on a stack and allows to reopen them with pressing Ctrl+Shift+T.

I developped a plugin for C::B, that does exact the same.

It's not possible to restore the tab-position, because we can not retrieve the position of the closed editor without (many) changes to the sdk.
If a project is closed all editor that belong to it will be removed from the stack. The stack will not be saved (at the moment) if the project closes.
It's designed as LIFO (last in first out).

Tested on linux and windows7.
Needed changes to the automake system (not to any distro-specific package files [rpm or debian]) are also included.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: New plugin: reopen last closed editor(s)
« Reply #1 on: December 23, 2010, 10:07:06 pm »
...that is a nice Christmas present you got there! :D In fact I missed such a feature, too.

...compiling!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: New plugin: reopen last closed editor(s)
« Reply #2 on: December 27, 2010, 12:54:15 pm »
 :lol: Great, this was on my todo list :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: New plugin: reopen last closed editor(s)
« Reply #3 on: December 27, 2010, 02:57:56 pm »
...oBFusCATed's post reminded me:

It just works. Well done! :P
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: New plugin: reopen last closed editor(s)
« Reply #4 on: January 13, 2011, 09:51:20 am »
...oBFusCATed's post reminded me:

It just works. Well done! :P

Are there any objections against adding it to the contrib-plugins in trunk ?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: New plugin: reopen last closed editor(s)
« Reply #5 on: January 13, 2011, 09:58:46 am »
I am in favor of adding it.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: New plugin: reopen last closed editor(s)
« Reply #6 on: January 13, 2011, 10:04:33 am »
No :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: New plugin: reopen last closed editor(s)
« Reply #7 on: January 13, 2011, 12:25:04 pm »
Are there any objections against adding it to the contrib-plugins in trunk ?
No - go ahead. I am already used to have this. Once you got it you won't live without it... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: New plugin: reopen last closed editor(s)
« Reply #8 on: January 13, 2011, 03:04:31 pm »
Done.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: New plugin: reopen last closed editor(s)
« Reply #9 on: January 14, 2011, 11:45:15 am »
Great, I tested it yesterday.

I have a request for the following use case :

I closed A, then B, then C. But now I need A again. This plugin helps me achieving that, but I have to reopen C and B first before it ends up at A.

Might it be possible that it shows a list pop up and I can click the one I want ?



Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: New plugin: reopen last closed editor(s)
« Reply #10 on: January 14, 2011, 11:50:38 am »
Great, I tested it yesterday.

I have a request for the following use case :

I closed A, then B, then C. But now I need A again. This plugin helps me achieving that, but I have to reopen C and B first before it ends up at A.

Might it be possible that it shows a list pop up and I can click the one I want ?


This is what I wanted to implement next, a second hotkey to popup a list to chose which editor to reopen, and probably to remove some editors from the list.
« Last Edit: January 18, 2011, 04:42:23 pm by jens »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: New plugin: reopen last closed editor(s)
« Reply #11 on: January 18, 2011, 04:45:54 pm »
Great, I tested it yesterday.

I have a request for the following use case :

I closed A, then B, then C. But now I need A again. This plugin helps me achieving that, but I have to reopen C and B first before it ends up at A.

Might it be possible that it shows a list pop up and I can click the one I want ?


This is what I wanted to implement next, a second hotkey to popup a list to chose which editor to reopen, and probably to remove some editors from the list.
It's in trunk now.
No popup-window, but a list either dockable or in Logs & others, configurable via "Settings -> Editor -> Reopen editor settings".
The list can be made visible (or hidden) via "View" menu.

You can reopen any file in the list with a double-click (or with return).
You can also delete or reopen all or the selected item(s) via context-menu (multi-selection is possible).