Author Topic: A "go back" option after "Find declaration/implementation of"  (Read 3901 times)

thursday1036pm

  • Guest
This has been discussed several times before.  A feature that would be very useful would be "Go back" for browsing source code.  Specifically, whenever you jump somewhere in code (through "Find declaration of", "Find implementation of", or double clicking an item in a Search), that should push your current cursor location and file (before going there) onto a stack.  When you click "Go back", it should pop that location off the stack and go there.  This functionality is implemented in many IDEs (CDT, IAR, even ctags, off the top of my head), and is very, very useful.

It appears in Code::Blocks there are two tools that are similar, but not exactly that.  There is the View -> Jump stuff.  The main limitation of this is it only appears to jump within one file (jump from file A to file B, jump back takes you to the top of file B).  Also I don't totally understand where it jumps back to (it usually ends up near where I started, like the top of the same function or loop)...

The other tool that is similar is the Browse Tracker plugin.  This seems to be a quick way of jumping between tabs.  It works well as long as you're jumping around in different files.  But frequently I want to jump around in the same file.  Also it only really works for one step backward (i.e. if I jump from file A to file B to file C, go back would take me to B as you'd expect, but then going back again would take me to C instead of A).

Is there any way to get the feature I'm describing?  Am I off my nut?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: A "go back" option after "Find declaration/implementation of"
« Reply #1 on: May 05, 2011, 04:22:33 pm »
I've a plugin in the works for this.
It is a bit frozen and a bit buggy.

Hopefully someday I'll finish it  :P
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: A "go back" option after "Find declaration/implementation of"
« Reply #2 on: May 05, 2011, 04:40:10 pm »
Quote
It appears in Code::Blocks there are two tools that are similar, but not exactly that.  There is the View -> Jump stuff.  The main limitation of this is it only appears to jump within one file (jump from file A to file B, jump back takes you to the top of file B).
I guess this menu item is supplied by brower tracker plugin.

Quote
jump from file A to file B, jump back takes you to the top of file B
I can confirm this, I guess it is a bug.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.