vscode Multi diff editor: implement focus and hasFocus

lskq00tm  于 22天前  发布在  Vscode
关注(0)|答案(5)|浏览(21)

这个问题是否在所有扩展都被禁用时发生?:是

  • VS Code 版本:1.86.0
  • OS 版本:MacOs

重现步骤:

  1. 将窗口分成2个标签组
  2. 在第一个标签组中打开普通编辑器。
  3. 在第二个标签组中打开多差异编辑器。
  4. 将焦点放在普通编辑器上。
  5. 运行 View: Focus Next Editor Group
    预期结果:多差异编辑器获得焦点。
    当前结果:普通编辑器保持聚焦。
t9eec4r0

t9eec4r01#

这个功能请求现在是我们待办事项列表的候选项目。社区有60天的时间对这个问题进行投票。如果它收到20个赞成票,我们将把它移到我们的待办事项列表中。如果没有,我们将关闭它。要了解更多关于我们如何处理功能请求的信息,请参阅我们的documentation
快乐编码!

abithluo

abithluo2#

@hediet the multi diff editor needs to make sure to implement some methods from EditorPane to better integrate into the workbench. For this specifically:

  • focus
  • hasFocus

I think you already have some experience in this area, given the merge editor:
vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.ts
Lines 455 to 468 in 983a3bc
| | overridefocus(): void{ |
| | super.focus(); |
| | |
| | (this.getControl()??this.inputResultView.editor).focus(); |
| | } |
| | |
| | overridehasFocus(): boolean{ |
| | for(const{ editor }of[this.input1View,this.input2View,this.inputResultView]){ |
| | if(editor.hasTextFocus()){ |
| | returntrue; |
| | } |
| | } |
| | returnsuper.hasFocus(); |
| | } |
Let me know if you need help.

nom7f22z

nom7f22z3#

在这里开始了PR #204970 ,但需要一些帮助。

b1zrtrql

b1zrtrql4#

已修复在 #204970
剩余的错误已在 #205567 中跟踪。

相关问题