TMOTTM
TMOTTM

Reputation: 3381

How to prevent VSCode from opening same file multiple times?

Assume you have index.js and service.ts in the side explorer. When I click on index.js, it opens in a view 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. Can VS Code be configured such that instead of opening the file again, it switches to the already open one?

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.

Upvotes: 5

Views: 1554

Answers (1)

Mark
Mark

Reputation: 180611

If I understand correctly, try this setting set to true:

  "workbench.editor.revealIfOpen": true,

Upvotes: 9

Related Questions