I'm using RStudio 1.4.1103 on Windows 10 with R 4.0.3. I quite often use Ctrl-Enter to step through scripts interactively. Recently, I've noticed that sometimes the lines of code end up being run out of order if I press Ctrl-Enter repeatedly. I'm not sure when this started occurring, but I wasn't aware of this occurring until the last couple of months and I expect may reflect a relatively recent change in RStudio.
Possibly relevant observations:
- Occurs both within .Rmd and .R files
- Not consistently reproducible, but currently happening at least once a day
- Selecting a bunch of lines and then pressing Ctrl-Enter does not cause a problem
- Similarly, waiting for each line to finish executing before pressing Ctrl-Enter does not cause a problem
- Not sure if this is relevant, but my current working directory is usually a networked folder (but that's nothing new)
The most obvious side effect of this is when a line executes out of order that relies on an object being created from the previous step, but sometimes it's subtler than that, particularly if an older version of the object already exists in the global environment.