Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: jens on December 23, 2010, 06:19:58 pm

Title: New plugin: reopen last closed editor(s)
Post by: jens 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.
Title: Re: New plugin: reopen last closed editor(s)
Post by: MortenMacFly 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!
Title: Re: New plugin: reopen last closed editor(s)
Post by: oBFusCATed on December 27, 2010, 12:54:15 pm
 :lol: Great, this was on my todo list :)
Title: Re: New plugin: reopen last closed editor(s)
Post by: MortenMacFly on December 27, 2010, 02:57:56 pm
...oBFusCATed's post reminded me:

It just works. Well done! :P
Title: Re: New plugin: reopen last closed editor(s)
Post by: jens 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 ?
Title: Re: New plugin: reopen last closed editor(s)
Post by: killerbot on January 13, 2011, 09:58:46 am
I am in favor of adding it.
Title: Re: New plugin: reopen last closed editor(s)
Post by: oBFusCATed on January 13, 2011, 10:04:33 am
No :)
Title: Re: New plugin: reopen last closed editor(s)
Post by: MortenMacFly 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... ;-)
Title: Re: New plugin: reopen last closed editor(s)
Post by: jens on January 13, 2011, 03:04:31 pm
Done.
Title: Re: New plugin: reopen last closed editor(s)
Post by: killerbot 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 ?


Title: Re: New plugin: reopen last closed editor(s)
Post by: jens 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.
Title: Re: New plugin: reopen last closed editor(s)
Post by: jens 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).