Issue when using visual editor with multiple source panes


I've identified what seems to be a bug with the Visual Editor mode.

I am working on an RMarkdown filein Visual Editor mode and also have another source pane with some code open.

When place my cursor onto a line of code in the RMarkdown fileand try to run it by hitting Ctrl+Enter, it instead tries to run the code in the other source pane, even though my cursor is in the RMarkdown document.

Switching the RMarkdown file from Visual Editor back to Source Editor solves the problem, which makes me think it might be an issue with the Visual Editor mode.

Another (possibly related) issue I've found is that when in Visual Editor mode, using the History > To Source button does not work for transferring code from History to RMarkdown. Again, this is fixed by switching RMarkdown back to Source Editor mode.


Just to say this is happening again in a different RStudio project, this time where I'm using viewing two RMarkdown files in separate panes. When I hit Ctrl+Enter, it runs the code in the left pane even though my cursor is on the right pane.


If you have a reproducible situation / examples / steps, I would recommend opening an issue in RStudio repo

Have you tried the last daily version too in case this is a known issue which has been fixed ?