簡體   English   中英

當資源管理器聚焦不工作時,VSCode 聚焦活動編輯器組

[英]VSCode Focus Active Editor Group when explorer is Focused Not Working

在 Windows 上的 VSCode 1.64.1 中,我正在嘗試創建一些用於聚焦的條件快捷方式。

當文件資源管理器聚焦時,我希望ctrl+0聚焦活動編輯器組。 當活動編輯器組聚焦時,我想ctrl+0聚焦資源管理器。 我嘗試了以下方法,但它只部分起作用。

目前,按ctrl+0將使資源管理器聚焦,但是當資源管理器聚焦時再次按ctrl+0不會按需要聚焦活動編輯器組:

//keybindings.json
  {
    "key": "ctrl+0",
    "command": "workbench.action.focusActiveEditorGroup",
    "when": "!editorTextFocus"
  },
  {
    "key": "ctrl+0",
    "command": "workbench.action.focusSideBar",
    "when": "!explorerFocus"
  }

我沒有看到explorerFocus上下文鍵。 以下確實有效:

{
  "key": "ctrl+0",
  "command": "workbench.action.focusActiveEditorGroup",
  "when": "!editorTextFocus"
},
{
  "key": "ctrl+0",
  "command": "workbench.action.focusSideBar",
  "when": "!filesExplorerFocus"                  // change here
}

顯然,當您使用不存在的上下文鍵時,根本不會評估when子句 - 就好像它不存在一樣。 由於對鍵綁定的評估是從文件底部開始的——從底部開始的第一個獲勝——你的focusActiveEditorGroup命令將永遠不會被看到。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM