Author Topic: Coming back to Orig. place after Find Implementation of xxx/ Find Declaration of  (Read 5787 times)

Offline foldingBLACKlinesSUCK

  • Multiple posting newcomer
  • *
  • Posts: 29
Hi,

Is it possible to comeback to the old position of cursor from where we do the "Find the Implementation of" from context menu?  :( :x



Please help  :(
« Last Edit: March 06, 2009, 11:36:43 pm by foldingBLACKlinesSUCK »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I have ask this question before.
You can enable browser tracker plugin to do the jump. You can search my post. :D
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.

Offline foldingBLACKlinesSUCK

  • Multiple posting newcomer
  • *
  • Posts: 29
I have ask this question before.
You can enable browser tracker plugin to do the jump. You can search my post. :D

But that only works if it  is an another (file) tab..

I have one HUGEOUNGOUS file, there of lots of references, that is why I am facing this trouble  :(

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I do agree with you in some aspects.

The browser track plugin can jump to another tab through "ALT + left arrow" or "ALT + right arrow"
It can also jump to different position in the same tab, using "ALT + up arrow" and "ALT + down arrow". There is a wiki page to describe more details.

What I want to suggest is that the "caret position" can be recorded automatically before each jump. So, browsering in a large project becomes easy. (That's the way "Visual assist" does).
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.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2775
...
What I want to suggest is that the "caret position" can be recorded automatically before each jump. So, browsering in a large project becomes easy. (That's the way "Visual assist" does).


How would you determine when a jump should be recorded.
What defines a "jump".

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
After thinking carefully for a while, I get the definition of a "recorded jump"
I'm not sure how to implement this functionality, I can only recall some code when I see in "implement undo and redo". So, we can define a Forward position stack and Backword position stack. Each entry of the stack contains two values ( the file name and the position line number )

1
If I use the context menu, then select "Go to declaration... " or "Go to definition...", then the caret position will be push to the Backword position stack before each jump.

2
If I click the mouse cross tabs, which means I change edit point from A.cpp to B.cpp, the caret position in A.cpp will be recorded.

3
If I scroll in the same source file, each time I click the mouse, the plugin will check whether it is far form the last edit point, eg, if it is more than 10 lines, then, the last caret position will be recored in the backword stack.

That's the way I think browser track plugin should work. Because in the current, I always feel some annoying when I jump to some where and forget the return position. I don't think all the 4 "alt + arrow" were needed. I just think use two of them is enough, that is "Jump backward" and "Jump forward".

Thank you, I know you are the author of this great plugin. :D
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
I always feel some annoying when I jump to some where and forget the return position.
BTW: Are you aware of the function "CTRL + PageUp/PageDown? This jumps to the next/previous method in the file. I use this very often to quickly navigate in a file. Hence it requires that CC has successfully parsed the methods of that file (which since ~r5000 is always the case for me...).
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
@MortenMacFly

Thanks for the hint. In fact, I haven't heard this short-cut before. :D

But I don't think the "ctrl + pageup/down" has some relationship with CodeCompletion, it is a functionality of "scintilla control".( I tested even when i open a large project and CC is still parsing, I can jump through ctrl + pageup/down).
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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
@MortenMacFly

Thanks for the hint. In fact, I haven't heard this short-cut before. :D

But I don't think the "ctrl + pageup/down" has some relationship with CodeCompletion, it is a functionality of "scintilla control".( I tested even when i open a large project and CC is still parsing, I can jump through ctrl + pageup/down).


After thinking carefully for a while,

That is something we should do more often (I mean thinking before writing).

Sometimes it's correct what a C::B dev tells you.

Look at codeompletion.cpp about line 1241: void CodeCompletion::GotoFunctionPrevNext(bool next /* = false */).



Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
@jens
Thanks, I do apologize for my carelessness. :oops:
@macfly
Sorry for my suspicion on your message. :(
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.