I recently have encountered an issue in debugging package code in RStudio. Suppose I have a function in source file, say foo.R
, and set a breakpoint in the body of that function. Then when I run something in the console that reaches that breakpoint, a second copy of foo.R
shows up in the code panel, and it pops to the foreground. The line where I had set the breakpoint is highlighted in the new view, but the red dot shows up in the first copy. This is driving me crazy because it happens with every single source file and makes a mess out of my code window.
Moreover, if I make changes in the first copy of the file, rebuild, and don't close the debug copy, then the changes are not shown in the debug copy if I still have active breakpoints. This is very confusing.
Here's an illustration of what I see after I entered a call. The first version of the file has the red dot; and you can see the tab for the second copy:
The second copy of the file is where debugging is displayed:
And this is what I had entered in the console:
I had the idea that this might v\have something to do with its immediately going from Browse[1]
to Browse[2]
. However, I tried debuggingState(on = FALSE)
and that doesn't make a difference.
This is not a bug I am able to reproduce. If I switch to a different project, this doesn't happen. It's apparently some setting in my project that got messed-up.