Author Topic: Navigation bug: Jump back/Frwd  (Read 639 times)

Offline pmlonline

  • Single posting newcomer
  • *
  • Posts: 4
Navigation bug: Jump back/Frwd
« on: March 14, 2018, 12:30:33 am »
I have Alt-left and Alt-right set to jump back and jump forward.  As you know, the jump back & forward feature is like a web browsers back and forward option.  I'll click on a file in the tab, then another file, and another file, etc., then press Alt-left numerous times it works. That is, each time it takes me back to the previous file I was looking at. Now, if I highlight a function that's in one of the files, right-click, and then select Find declaration of:, then the navigation jump history becomes messed up. Try jumping back. I don't know if it makes any difference, but in my project I have 12 .c files and 11 .h files opened, all displayed toward the top as tabs. I suspect the problem is that when I have codeblocks find and take me to the declaration that it searches through files and during this search it might be recording this activity in the jump history.

I'm using codeblocks 17.12 on the lastest Windows 10.

I just started using this feature, so I don't when it last worked, if ever.

Thanks!
« Last Edit: March 14, 2018, 04:31:56 pm by pmlonline »

Offline pmlonline

  • Single posting newcomer
  • *
  • Posts: 4
Re: Navigation bug: Jump back/Frwd
« Reply #1 on: March 14, 2018, 04:29:32 pm »
Correction: When highlighting a function and right-clicking on it, try selecting Find declaration of: (Not Find Implementation of:). That seems to produce the issue more often where it will mess up the jump history.
« Last Edit: March 14, 2018, 04:32:47 pm by pmlonline »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5062
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Navigation bug: Jump back/Frwd
« Reply #2 on: March 14, 2018, 04:55:04 pm »
I did some simple test, and I can't reproduce this bug.

Please note that Find declaration of or Find Implementation of is features of CodeCompletion plugin, and Jump backword and forward is from the Browser tracker plugin.
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 pmlonline

  • Single posting newcomer
  • *
  • Posts: 4
Re: Navigation bug: Jump back/Frwd
« Reply #3 on: March 14, 2018, 05:27:07 pm »
I'll create a dummy project example that demonstrates the bug and upload it in a bit.

Offline pmlonline

  • Single posting newcomer
  • *
  • Posts: 4
Re: Navigation bug: Jump back/Frwd
« Reply #4 on: March 14, 2018, 05:56:25 pm »
Okay try this. It happens every time for me. First, load jump-bug.cbp, then exit codeblocks.

1. Start Codeblocks
2. Under Recent projects click jump-bug.cbp
3. Open all 9 files. Click on main.c.
4. Exit codeblocks.
5. Start codeblocks & click on jump-bug.cbp. It starts me in Main.c tab. Toward top of screen I have 9 file tabs.
6. Click on the following tabs in this order: a.c a.h b.c b.h c.c c.h d.c d.h
7. Press Alt-left (or whatever you have Jump back set to, or in menu click View > Jump > Jump back. It takes me to c.h, which is wrong. It should take me to d.c

Also, if you keep pressing Alt-left it will skip over b.c as well.

Any ideas how to fix this in the codeblocks source? Thanks for any help.
« Last Edit: March 14, 2018, 06:01:20 pm by pmlonline »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5062
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Navigation bug: Jump back/Frwd
« Reply #5 on: March 16, 2018, 03:47:54 pm »
Okay try this. It happens every time for me. First, load jump-bug.cbp, then exit codeblocks.

1. Start Codeblocks
2. Under Recent projects click jump-bug.cbp
3. Open all 9 files. Click on main.c.
4. Exit codeblocks.
5. Start codeblocks & click on jump-bug.cbp. It starts me in Main.c tab. Toward top of screen I have 9 file tabs.
6. Click on the following tabs in this order: a.c a.h b.c b.h c.c c.h d.c d.h
7. Press Alt-left (or whatever you have Jump back set to, or in menu click View > Jump > Jump back. It takes me to c.h, which is wrong. It should take me to d.c

Also, if you keep pressing Alt-left it will skip over b.c as well.

Any ideas how to fix this in the codeblocks source? Thanks for any help.

Hi, thanks for the steps, I can fully reproduce those bugs.
@pecan, can you have a look?  :)
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: 2102
Re: Navigation bug: Jump back/Frwd
« Reply #6 on: March 19, 2018, 07:57:59 pm »
Acknowledge, I'll work on it.