I'm working with a Sweave (.Rnw) file in TeXStudio (2.11.0). I have set up custom build commands to knit the Sweave file to LaTeX, with the idea to work on the .Rnw file exclusively.
My problem is that TeXStudio automatically opens the corresponding .tex file, when I examine the preview PDF. As both .Rnw and .tex look about the same, it is very easy to inadvertently continue editing the .tex file instead of the .Rnw, and get the recent changes overwritten at a later stage, when the .Rnw is knit to .tex. I try to keep this in mind, but accidents still occur now and then, despite my best efforts. Only a small extra tab appears when the .tex file is opened, and when you have many windows open, this is easy to miss.
I have tried disabling the "Cursor follows scrolling" and its opposite option at the bottom of the preview pane; that did not work. I also could not find anything in the Settings to prevent the .tex from opening automatically.
I wonder if there is a solution to prevent the .tex file from opening automatically. Thank you!