basickarl
basickarl

Reputation: 40561

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?

Upvotes: 56

Views: 7905

Answers (4)

rawpower
rawpower

Reputation: 2180

Update v1.11.0 - March 2017

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

"workbench.editor.revealIfOpen": true

In the Settings GUI search for: Workbench > Editor: Reveal If Open

Upvotes: 109

Captain Fantastic
Captain Fantastic

Reputation: 452

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

Upvotes: 3

Dingus45191
Dingus45191

Reputation: 569

Just update VS Code and if still doesn't work after update reinstall it. It happened to me and reinstalling solved my problem.

Upvotes: 1

basickarl
basickarl

Reputation: 40561

Afaiak this has now been fixed in the latest updates of the application, as when editing one file, the other files also updates now.

Upvotes: 0

Related Questions