edamagit: Tab/magit.toggle-fold not working

tl;dr: magit.toggle-fold doesn’t work to expand anything in the magit window.

When on the Staged changes line in the magit window (or any other line for that matter), pressing tab doesn’t appear to do anything. Happy to provide any other details to troubleshoot this, just not sure where to go.

Output from Developer Toggle Keyboard Shortcuts Troubleshooting:

[2022-10-26 09:42:35.557] [renderer1] [info] [KeybindingService]: / Received  keydown event - modifiers: [], code: Tab, keyCode: 9, key: Tab
[2022-10-26 09:42:35.568] [renderer1] [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: Tab, keyCode: 2 ('Tab')
[2022-10-26 09:42:35.568] [renderer1] [info] [KeybindingService]: | Resolving [Tab]
[2022-10-26 09:42:35.568] [renderer1] [info] [KeybindingService]: \ From 12 keybinding entries, matched magit.toggle-fold, when: editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/, source: user extension kahole.magit.
[2022-10-26 09:42:35.569] [renderer1] [info] [KeybindingService]: + Invoking command magit.toggle-fold.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I recently ran into this issue. In my case, it seemed to be caused by the tab key getting swallowed by a Vim extension. In edamagit’s readme it suggests adding the following to your keybindings.json:

  {
    "key": "tab",
    "command": "extension.vim_tab",
    "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert' && editorLangId != 'magit'"
  },
  {
    "key": "tab",
    "command": "-extension.vim_tab",
    "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
  },

I noticed that the entry for removal had a when key, whereas others did not. I tried removing the when clause from the removal and tab now works as expected. My keybindings.json now has the following instead of the above:

  {
    "command": "extension.vim_tab",
    "key": "tab",
    "when": "editorFocus && vim.active && !inDebugRepl && vim.mode != 'Insert' && editorLangId != 'magit'"
  },
  {
    "command": "-extension.vim_tab",
    "key": "tab"
  },

Deploying now

In my case, pressing tab doesn’t work, but running the actual command magit.toggle-fold toggles the changes at point; but does nothing to changes in other files.

If I run magit.toggle-fold, then future changes appear unfolded for the specific file.

Any relevant output in cmd+shift+P -> Developer: Show Logs -> Extensions Host ?

I tried it and had no output whatsoever.