Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio Code - prevent same file opening twice

enter image description here

It's happened a few times before that I've opened the same file twice and forgotten about it. Meaning I was editing the same file in both panes, which means two versions of the same file. This led to bugs and me not understanding why me code was not being run properly.

Is there a setting which prevents having the same file open twice?

like image 611
basickarl Avatar asked Oct 06 '16 08:10

basickarl


People also ask

How do I open the same File twice in Visual Studio Code?

First, you can click on the divider bar at the top of the scroll bar on the right side of your editor window. Dragging that bar down divides your code window into two panes (one on top of the other), which you can scroll through independently.

How do you stop a loop code in Visual Studio?

You can stop any running command by pressing Ctrl + C on your keyboard.


2 Answers

Update v1.11.0 - March 2017

I submitted this PR, and you can now use the setting:

"workbench.editor.revealIfOpen": true 
like image 101
rawpower Avatar answered Sep 20 '22 14:09

rawpower


It looks like under Edit-Preferences there is a checkbox for the setting, Workbench - Editor: Reveal If Open: enter image description here

like image 44
Captain Fantastic Avatar answered Sep 22 '22 14:09

Captain Fantastic