nakst/gf

Jump to active file on step

aolo2 opened this issue · 1 comments

aolo2 commented

There is a bug with the newly introduced directory browser feature. If I select a file, but the execution point is currently in another file, then the gf tries to apply line numbers from one file to another.

For example:

  1. I step into main() in main.c (let's say it's on line 600)
  2. I switch to another file, say other.c
  3. I press F10 to step over one line
  4. gf tries to display other.c:601, intead of switching to main.c:601

I guess to fix this you have to keep track of two files: one which is selected by the user, and one which is dictated by the exection point. Then the first one is updated from the UI (directory browser), and the second one is updated by gdb. Most importantly, if gdb says that the file is different from the user-selected one, you should switch to it.

nakst commented

Fixed in cb405cf.