Document `["editor::ToggleComments", {"advance_downwards": true}]`
Currently this feature is not very discoverable.
We should have some documentation and examples in the default keymap for this so people can know it exists!
We could make it the default, however, that could potentially be an annoying change for existing users.
Stumbled upon advance_downwards when remapping ToggleComments and so far can't figure out what it does 😅 when I set it to true my keybinding doesn't seem to do anything 🤔
The intended behavior is that with "advance_downwards" set to true, when you toggle a comment on a line we advance your cursor down one line making it chainable. Could you share your keybind definition so I could try and figure out what's going wrong? It works fine for me when I use the exact syntax in the issue title
Sorry for the late reply
This one right?
// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
{
"context": "Workspace",
"bindings": {
// "shift shift": "file_finder::Toggle"
"alt-cmd-v": "workspace::ToggleVimMode"
}
},
{
"context": "Editor",
"bindings": {
// "j k": ["workspace::SendKeystrokes", "escape"]
"ctrl-tab": "editor::Outdent",
"shift-tab": "tab_switcher::Toggle",
"cmd-shift-7": ["editor::ToggleComments", { "advance_downwards": false }]
}
},
{
"context": "Workspace",
"bindings": {
"cmd-1": ["pane::ActivateItem", 0],
"cmd-2": ["pane::ActivateItem", 1],
"cmd-3": ["pane::ActivateItem", 2],
"cmd-4": ["pane::ActivateItem", 3],
"cmd-5": ["pane::ActivateItem", 4],
"cmd-6": ["pane::ActivateItem", 5],
"cmd-7": ["pane::ActivateItem", 6],
"cmd-8": ["pane::ActivateItem", 7],
"cmd-9": ["pane::ActivateItem", 8],
"cmd-0": "pane::ActivateLastItem"
}
},
{
"context": "Editor",
"bindings": {
"cmd-1": ["pane::ActivateItem", 0],
"cmd-2": ["pane::ActivateItem", 1],
"cmd-3": ["pane::ActivateItem", 2],
"cmd-4": ["pane::ActivateItem", 3],
"cmd-5": ["pane::ActivateItem", 4],
"cmd-6": ["pane::ActivateItem", 5],
"cmd-7": ["pane::ActivateItem", 6],
"cmd-8": ["pane::ActivateItem", 7],
"cmd-9": ["pane::ActivateItem", 8],
"cmd-0": "pane::ActivateLastItem"
}
}
]
Hmm, this seems to be a bug. When I try your binding (cmd-shift-7) with the key context view open (dev: open key context view) when I enter your binding the key context view shows the entered binding as cmd-&. Fortunately, changing the binding from cmd-shift-7 to cmd-& fixes it for me on an English layout.