VSCODE:如何专注于编辑器
在我的Visual Studio代码扩展程序中,我当前调用WorkBench.Action.MoveEditorTonextGroup
将编辑器移动代码。但是,如果我调用任何额外的命令,它将使用以前的编辑器组,而不是我将其移至的编辑组。
如何将重点放在某个编辑器上,例如我搬到的编辑器?
In my Visual Studio code extension, I currently call workbench.action.moveEditorToNextGroup
which moves the editor in code. However, if I call any extra commands, it will use the previous editor group rather than the one I moved it to.
How can I focus to a certain editor such as the one I move to?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(2)
看起来
workbench.action.focusfirsteditorgroup
应该做tick。另外,
workbench.action.focusfirsteditorgroup
workbench.action.focussecondoritorgrou
...
也可能是您想要的。
请参阅文档有关完整列表
It looks like
workbench.action.focusFirstEditorGroup
should do the tick.Alternatively,
workbench.action.focusFirstEditorGroup
workbench.action.focusSecondEditorGrou
...
May also be what you are looking for.
See docs for full list
移动编辑器的一种更强大的方法是使用
MoveActiveEditor
命令。最好的文档位于此处: moveActiveEditor解释。
如果我反复打电话给它,它使用我刚移动的编辑器。因此,例如,如果我将编辑器移至正确的组,然后再次触发命令,则将同一编辑器移至下一个正确的组。
如果命令还没有,则该命令将在右侧创建一个组。
不幸的是,有了这些选项:
您也应该能够将编辑器移至第二组 - 即使不存在 - 但是此表单不会创建第二组并默默失败。我认为这是一个错误,会提出问题。
您还可以使用
MoveActiveEditor
命令将编辑器轻松地移动到组中,以这样的代码:它将将活动编辑器移至
value
column th3e当前组中的列。value
是基于1的,因此组中的第一列是1
,而不是0
。A more powerful way to move editors is to use the
moveActiveEditor
command.The best documentation is located here: moveActiveEditor explanation.
If I call that repeatedly, it uses the editor I just moved. So, for instance, if I move an editor to the right group, and then trigger the command again, that same editor is moved to the next right group.
The command will create a group to the right if there isn't already one there.
Unfortunately, with these options:
you should also be able to move an editor to a second group - even if it doesn't exist - but this form will NOT create the second group and silently fails. I consider that a bug and will file an issue.
You can also use the
moveActiveEditor
command to move editors within groups easily with code like this:which will move the ACTIVE editor to the
value
column within th3e current group. Thevalue
is 1-based, so the first column in a group is1
, not0
.