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

自闭症网瘾萝莉.ら 提交于 2019-12-03 20:33:44

问题


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?


回答1:


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



回答2:


When you select a file from search result -> you will see the file open with file name italicized. This means that the file is open in preview mode. Now any other file you choose to select will replace its content in this tab.

To make this tab stick among the open tabs you can:

double click to select the file or double click on already selected file in search pane -> you will see the name of file is not italicized anymore(meaning the file is now pinned as a tab)

Alternatively,

You can use the below setting to have all selected files open as a separate tab:

"workbench.editor.enablePreview": false

This setting is found here : Files -> Preferences-> Settings

But the downside of using this is that all files you click on will remain opened and you would then need to clean tabs after your search.



来源:https://stackoverflow.com/questions/43605338/visual-studio-code-closes-my-file-when-i-search-for-new-ones

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!