Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: photon3108 on October 16, 2013, 03:43:13 AM

Title: How to go back after "Goto Implementation"?
Post by: photon3108 on October 16, 2013, 03:43:13 AM
01: int test() {
02: }
03:
04: int main() {
05:     test();
06: }

After "Goto Impelementation" at line 05, how to go back to line 05 from line 01?
It's not a good idea to use "Goto Line" or "Bookmark" because they are not convenient.
Title: Re: How to go back after "Goto Implementation"?
Post by: ollydbg on October 16, 2013, 08:24:40 AM
There is a function you can use:
Menu->View->Jump->Jump back, note: you should have browsetracker plugin installed.
Title: Re: How to go back after "Goto Implementation"?
Post by: photon3108 on October 16, 2013, 08:46:03 AM
Sometimes "Jump back" doesn't work.
I have installed Browse Tracker. Should I click any box in View->Browse Tracker->Setting?
Title: Re: How to go back after "Goto Implementation"?
Post by: ollydbg on October 16, 2013, 09:09:36 AM
Quote from: photon3108 on October 16, 2013, 08:46:03 AM
Sometimes "Jump back" doesn't work.
If the previous jump is too small, I mean you jump from the line 5 to line 1, which is only 4 lines, then I think BrowserTracker will not record the new caret position, so you can not jump back in a small jump.
I guess the minimal lines are 10 lines or more, I have not checked its source code yet. ;)
Quote
I have installed Browse Tracker. Should I click any box in View->Browse Tracker->Setting?
No.
Title: Re: How to go back after "Goto Implementation"?
Post by: Pecan on October 21, 2013, 07:50:11 PM
BrowseTracker remembers only one location per half page.
Title: Re: How to go back after "Goto Implementation"?
Post by: photon3108 on October 22, 2013, 07:12:11 AM
These days, I use "Jump back" many times. It didn't always jump back the location where I jump from.
Sometimes it is near the location, sometimes not and sometimes correct. I only use "Goto Implementation".
Title: Re: How to go back after "Goto Implementation"?
Post by: ollydbg on October 22, 2013, 07:41:19 AM
Quote from: photon3108 on October 22, 2013, 07:12:11 AM
It didn't always jump back the location where I jump from.
Me to.
I suspect this is a bug, but it is not easy to reproduce this bug.
Title: Re: How to go back after "Goto Implementation"?
Post by: frithjofh on October 22, 2013, 12:58:12 PM
hi,

maybe a stupid question, but did you edit the file before the jump? like adding or erasing a line? maybe the jump back jumps to the original line number, but not to the original line as these may have shifted...

regards
Title: Re: How to go back after "Goto Implementation"?
Post by: photon3108 on October 23, 2013, 07:36:16 AM
Anyway, it should jump back to the correct location when I do it immediately after "Goto Impelentation".
In the case, I am pretty sure that Codeblocks didn't always do it well.