VSCODE:防止文件在新标签中打开
我有两个文件并排打开,如图中所示:
如果我 ctrl +单击函数名称左窗格中的两个
,我希望VSCODE将vScode切换为已打开的文件第二。 py
在右窗格中。相反,VSCODE在当前左窗格的新选项卡中打开文件second.py
(在红色矩形指示的位置)。现在,您有三个选项卡,而不是两个选项卡,first.py
从视图中遮盖了。
如何更改此行为,以使VSCODE焦点已经打开了选项卡,而不是打开一个新的冗余选项卡?
I have two files open side by side like shown in the picture:
If I Ctrl+Click the function name two
in the left pane, I want VSCode to switch focus to already opened file second.py
in the right pane. Instead, VSCode opens file second.py
in a new tab in the current left pane (in a place indicated by red rectangle). Now you have three tabs instead of two, and first.py
is obscured from view.
How can I change this behavior so that VSCode focuses already opened tab, instead of opening a new, redundant tab?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当问题发布在这里时,也许这是不可用的,但是现在有专门的设置要这样做:
Perhaps this wasn't available when the question was posted here but there's dedicated setting to do this now:
我通过以下操作在Windows上的VS代码中解决了此问题:
:
“ workbench.editor.editor.enable.enablepreview”:false“:false” << 是此解决方案的可选部分
/代码>当您单击文件时,这 打开一个文件,如果该文件已经打开,它将聚焦该文件的选项卡。
I solved this in VS Code on windows by doing the following:
"workbench.editor.enablePreview": false"
means when you click a file it stays open. This is an optional part of this solution but I think it makes for a better DX."window.openFilesInNewWindow": "off"
means when you open a file it will focus the tab of that file if it is already open.