简体   繁体   English

如何防止VSCode多次打开同一文件?

[英]How to prevent VSCode from opening same file multiple times?

Assume you have index.js and service.ts in the side explorer. 假设您在侧面资源管理器中有index.jsservice.ts When I click on index.js , it opens in a view A . 当我单击index.js ,它将在视图A打开。 Then I open service.ts in a separate view B right to the first one and keep the focus in B and then click on index.js in the sidebar, it also opens in B . 然后,我在第一个视图B的第一个视图中打开service.ts ,将焦点保持在B ,然后单击侧栏中的index.js ,它也在B打开。 Can VS Code be configured such that instead of opening the file again, it switches to the already open one? 可以配置VS Code,以便与其再次打开文件,而切换到已经打开的文件吗?

Additionally, if I really want the file open twice, I could open it a second time by double clicking it or dragging it to the view where it isnt present already. 另外,如果我确实希望打开该文件两次,则可以通过双击该文件或将其拖动到尚不存在的视图中来再次打开该文件。

如果我理解正确,请尝试将此设置设置为true

  "workbench.editor.revealIfOpen": true,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 VSCode:从同一例程中打开文件夹和文件 - VSCode: opening a folder and a file from the same routine 如何防止 VSCode 在启动时打开所有 git 存储库? - How to prevent VSCode from opening all git repositories at startup? 防止 VSCode 从 WSL 以 root 身份打开 - Prevent VSCode opening as root from WSL VSCode:防止文件在新选项卡中打开,而是将注意力集中在另一个窗格中已打开的选项卡上 - VSCode: Prevent file from opening in a new tab and instead focus to already opened tab in another pane 如何防止文件在同一个 VS Code 实例中打开? - How to prevent files from opening in the same instance of VS Code? 关闭远程 WSL 连接后如何防止打开新的空 VSCode 实例 - How to prevent a new empty VSCode instance from opening after closing a remote WSL connection 如何防止 VSCode 代码运行器扩展在我运行时打开第二个代码终端 - How to prevent VSCode code runner extension from opening second code terminal when I run it 如何防止 VSCode 删除 CSV 文件中行尾的制表符? - How to prevent VSCode from removing tabs at the end of lines in a CSV file? 从终端打开 vscode 文件挂起 - Opening vscode file from terminal hangs 每次保存后如何防止VSCode打开输出面板? - How to prevent VSCode opening output panel after each save?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM