Visual Studio Code closes my file when I search for new ones

Samurai Jack picture Samurai Jack · Apr 25, 2017 · Viewed 12.7k times · Source

I'm using Visual Studio Code for working and I use ctrl-P command to search for files in my directory.

The problem appears when I want to search for another file, it opens it in the place of the first searched file, closing it.

Is any setting for avoiding this pain?

Answer

Matt Bierner picture Matt Bierner · Apr 25, 2017

By default, VSCode opens files in preview mode. This is indicated by their name being italic in the menu bar. As John noted, you can double click on the file to fully open it.

To disable this behavior, try setting:

"workbench.editor.enablePreview": false