visual-studio-code

VSCode: Context key to detect left/right split pane?


I'm working with Visual Studio Code and trying to create a custom keybinding that behaves differently depending on whether the cursor is in the left or right pane of a split editor.

My question is: Are there any context keys in VSCode that can detect whether the active editor is in the left or right pane of a split view? If not, is there an alternative way to achieve this distinction in keybindings or settings? I've searched the VSCode documentation and experimented with various context keys, but so far haven't found a solution. Any insights or workarounds would be greatly appreciated.

Environment: Visual Studio Code Version: Version: 1.89.1 (User setup) OS: Windows_NT x64

I've enabled Developer Mode and used the "Developer: Inspect Context Keys" command to search for relevant context keys, but haven't found anything that distinguishes between left and right split panes.


Solution

  • Most probably you can get pretty far using groupEditorsCount and activeEditorGroupIndex: