zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
46.58k stars 2.64k forks source link

CollapseAllEntries not working with keymap on Linux #14698

Open sant123 opened 1 month ago

sant123 commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

[
  {
    "bindings": {
      "ctrl-alt-m": "project_panel::CollapseAllEntries"
    }
  }
]

This shortcut does not work unless the left panel is focused, is it possible to make it work everywhere?

Thanks!

Environment

Zed: v0.144.3 (Zed) OS: Linux Wayland fedora 40 Memory: 15.5 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log


notpeter commented 1 month ago

Yep. The project_panel::CollapseAllEntries action is currently only available when the project panel is in focus, ideally this would be available from the rest of the workspace as well. This is not Linux specific, same on MacOS.

VScode lets you do it globally, even if the file explorer / project panel sidebar is closed.

rawkode commented 1 week ago

Struggled with this too, but found a workaround using SendKeystrokes:

[
  {
    "context": "ProjectPanel",
    "bindings": {
      "c": "project_panel::CollapseAllEntries"
    }
  },
  {
    "context": "Editor && vim_mode == normal && vim_operator == none && !VimWating",
    "bindings": {
      ", w":  "pane::CloseActiveItem",
      ", p": "project_panel::ToggleFocus",
      ", ;":  "pane::CloseAllItems",
      ", l": [
        "workspace::SendKeystrokes",
        ", ; , p c"
      ]
    }
  }
]