Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab/magit.toggle-fold not working #228

Closed
bryan-lott opened this issue Oct 26, 2022 · 15 comments · Fixed by #293
Closed

Tab/magit.toggle-fold not working #228

bryan-lott opened this issue Oct 26, 2022 · 15 comments · Fixed by #293

Comments

@bryan-lott
Copy link

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.
@bryan-lott
Copy link
Author

Quick update:
magit.toggle-fold works to collapse and expand the Unstaged changes and Recent commits portions of the window, but files or commits underneath those two sections don't expand.

Would love to know how I can add more information here to potentially make this reproducable.

@bryan-lott
Copy link
Author

I've disabled all extensions other than edamagit and am getting the same behavior.

@kahole
Copy link
Owner

kahole commented Dec 20, 2022

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

@bryan-lott
Copy link
Author

I don't see anything relelvant, no output when hitting tab or magit.toggle-fold:

2022-12-21 09:16:22.103 [info] Eager extensions activated
2022-12-21 09:16:22.241 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.247 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.248 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.248 [info] ExtensionService#_doActivateExtension aaron-bond.better-comments, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.249 [info] ExtensionService#_doActivateExtension alefragnani.project-manager, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.249 [info] ExtensionService#_doActivateExtension alefragnani.separators, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.249 [info] ExtensionService#_doActivateExtension littlefoxteam.vscode-python-test-adapter, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.249 [info] ExtensionService#_doActivateExtension MalcolmMielle.semantic-highlighting, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.255 [info] ExtensionService#_doActivateExtension SonarSource.sonarlint-vscode, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.255 [info] ExtensionService#_doActivateExtension usernamehw.errorlens, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.257 [info] ExtensionService#_doActivateExtension vscode-icons-team.vscode-icons, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:22.257 [info] ExtensionService#_doActivateExtension VSpaceCode.whichkey, startup: false, activationEvent: 'onStartupFinished', root cause: VSpaceCode.vspacecode
2022-12-21 09:16:23.663 [info] ExtensionService#_doActivateExtension VSpaceCode.vspacecode, startup: false, activationEvent: 'onStartupFinished'
2022-12-21 09:16:45.227 [info] ExtensionService#_doActivateExtension kahole.magit, startup: false, activationEvent: 'onCommand:magit.status'

@aszenz
Copy link

aszenz commented May 25, 2023

Facing similar issue fold doesn't work on unstaged/staged files view

@mario-bermonti
Copy link

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.

@ajmcmiddlin
Copy link
Contributor

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"
  },

@aszenz
Copy link

aszenz commented Jan 8, 2024

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:

I made this change but the original issue of fold not working on files is still their, the sections like unstaged changes themselves do fold/unfold but the files under them do not.
I tried disabling the vim extension but the problem still persists with nothing to show in the logs.

Does folding/unfolding work for you on files or only on the sections?

@kahole
Copy link
Owner

kahole commented Jan 8, 2024

Is there something in your git config that is non-default? edamagit does not support different git configs as well as it should, see: #276

@aszenz
Copy link

aszenz commented Jan 8, 2024

Is there something in your git config that is non-default? edamagit does not support different git configs as well as it should, see: #276

Thanks that indeed was the case, I had an external diff provider in the config:

[diff]
  external = difft

Removing it solves the issue of unfolding files.

But is it expected that unfolding a recent commit doesn't show it's files changed, and one has to enter the commit first.

I would kind of like folding to be nested on all sections so i can do:

unfold section -> unfold commit > unfold modified file

theherk added a commit to theherk/commons that referenced this issue Jan 14, 2024
@WaffleLapkin
Copy link

@aszenz have you fond any other workarounds, besides disabling diff.external on a config basis?

@aszenz
Copy link

aszenz commented Feb 13, 2024

@aszenz have you fond any other workarounds, besides disabling diff.external on a config basis?

Not yet, ideally i would prefer for magit to unset external diff when running the git cmd, that way i can continue to use external diff via cli

@WaffleLapkin
Copy link

There is a --no-ext-diff, but it doesn't work for some sub commands (so I presume it needs to be passed specifically to git diff).

I tried using "magit.git-path" to specify a custom wrapper that would add --no-ext-diff, but this extension seems to ignore that option for some unknown reason (and I don't see any logs).

garymm added a commit to garymm/edamagit that referenced this issue Mar 25, 2024
If a user has the following set in their git config:

```properties
[diff]
  external = difft
```

edmagit will fail to parse the `git diff` output. This should fix that.

Fixes kahole#228
@WaffleLapkin
Copy link

@kahole even though you updated the changelog, a new extension version doesn't seem to be published (https://marketplace.visualstudio.com/items?itemName=kahole.magit says that the latest version is 0.6.59, not 0.6.60). Could you publish a new version?

@kahole
Copy link
Owner

kahole commented Apr 3, 2024

Deploying now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants