Skip to content

Commit d8e7c95

Browse files
committed
Fix toggling comments in Zed.
1 parent fc710a0 commit d8e7c95

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

lib/tasks/zed.rake

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,20 @@ task :zed => [:'brew:casks_and_formulae'] do
5050
},
5151
)
5252

53-
next unless linux?
53+
editor_bindings = if linux?
54+
{
55+
'ctrl-shift-c': 'editor::Copy',
56+
'ctrl-shift-v': 'editor::Paste',
57+
'ctrl-shift-x': 'editor::Cut',
58+
'ctrl-k': 'editor::DeleteToEndOfLine',
59+
}
60+
elsif macos?
61+
{
62+
'cmd-shift-7': ['editor::ToggleComments', { advance_downwards: false }],
63+
}
64+
else
65+
{}
66+
end
5467

5568
zed_keymap.write JSON.pretty_generate([
5669
{
@@ -59,12 +72,7 @@ task :zed => [:'brew:casks_and_formulae'] do
5972
},
6073
{
6174
context: 'Editor',
62-
bindings: {
63-
'ctrl-shift-c': 'editor::Copy',
64-
'ctrl-shift-v': 'editor::Paste',
65-
'ctrl-shift-x': 'editor::Cut',
66-
'ctrl-k': 'editor::DeleteToEndOfLine',
67-
},
75+
bindings: editor_bindings,
6876
},
6977
{
7078
context: 'Terminal',

0 commit comments

Comments
 (0)