fish: fix the binds.*.erase option (#7186)

The `command` option is optional when the `erase` option is true,
because when in erase mode, bind does not require any other arguments
This commit is contained in:
Mohamad Fikri 2025-06-07 03:57:26 +07:00 committed by GitHub
parent 1d595a5b64
commit 2d7d65f65b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 111 additions and 82 deletions

View file

@ -21,6 +21,10 @@
"repaint"
];
};
"alt-s".erase = true;
"alt-s".operate = "preset";
"alt-s".command = "fish_commandline_prepend sudo";
};
};
@ -40,6 +44,10 @@
"bind --mode insert ctrl-c kill-whole-line repaint"
assertFileContains home-files/.config/fish/functions/fish_user_key_bindings.fish \
"bind ctrl-g 'git diff' repaint"
assertFileContains home-files/.config/fish/functions/fish_user_key_bindings.fish \
"bind -e --preset alt-s"
assertFileContains home-files/.config/fish/functions/fish_user_key_bindings.fish \
"bind --preset alt-s 'fish_commandline_prepend sudo"
'';
};
};