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
39.06k stars 2.02k forks source link

Can't use cmd-shift-+, cmd-shift-- or cmd-=, cmd-- bindings to fold and unfold code blocks #11797

Open sudomf opened 1 month ago

sudomf commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Hey.

Here is my keybindings config:

{
    "bindings": {
      "up": "menu::SelectPrev",
      "pageup": "menu::SelectFirst",
      "shift-pageup": "menu::SelectFirst",
      "ctrl-p": "menu::SelectPrev",
      "down": "menu::SelectNext",
      "pagedown": "menu::SelectLast",
      "shift-pagedown": "menu::SelectFirst",
      "ctrl-n": "menu::SelectNext",
      "cmd-up": "menu::SelectFirst",
      "cmd-down": "menu::SelectLast",
      "enter": "menu::Confirm",
      "cmd-enter": "menu::SecondaryConfirm",
      "escape": "menu::Cancel",
      "ctrl-c": "menu::Cancel",
      "shift-escape": "workspace::ToggleZoom",
      "cmd-o": "workspace::Open",
      "cmd-0": "zed::ResetBufferFontSize",
      "cmd-=": "zed::IncreaseBufferFontSize",
      "cmd--": "zed::DecreaseBufferFontSize",
      "cmd-,": "zed::OpenSettings",
      "cmd-q": "zed::Quit",
      "cmd-h": "zed::Hide",
      "alt-cmd-h": "zed::HideOthers",
      "cmd-m": "zed::Minimize",
      "ctrl-cmd-f": "zed::ToggleFullScreen",
      "cmd-left": "pane::GoBack",
      "cmd-right": "pane::GoForward",
      "ctrl-shift-f": "pane::DeploySearch",
      "ctrl-shift-n": "file_finder::Toggle",
      "cmd-shift-+": "editor::FoldAt",
      "cmd-shift--": "editor::UnfoldAt"
      // "cmd-=": "editor::FoldAt",
      // "cmd--": "editor::UnfoldAt"
    }
  }

I tried a lot of things to make editor::Fold and editor::UnfoldLines to work with cmd-shift-+ and cmd-shift--. But the editor keeps changing the buffer size, instead of just fold and unfold code blocks.

Can someone please help me?

Environment

Zed: v0.135.1 (Zed Preview) OS: macOS 14.4.1 Memory: 16 GiB Architecture: aarch64

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

https://github.com/zed-industries/zed/assets/2893850/ae3b78bc-bfaa-476b-bb5e-1638ac7f2c74

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

JosephTLyons commented 3 weeks ago

Also to note it, it seems that we can't bind cmd-_ either: