Update $fish_cursor_selection_mode in vi/default bindings

Introduced with 3.6.0 `fish_cursor_selection_mode` variable breaks
existing vi bindings (for example, input sequence `abc<Esc>0vd` doesn't
delete the `a` character as would be expected).

This patch fixes it by switching `fish_cursor_selection_mode` to
`inclusive` and back.
This commit is contained in:
Sergei Shilovsky 2022-10-05 23:11:43 +03:00 committed by Fabian Boehm
parent aa30774b0d
commit 022f42c3cd
2 changed files with 3 additions and 0 deletions

View file

@ -104,4 +104,6 @@ function fish_default_key_bindings -d "emacs-like key binds"
# the following to tell a console to paste:
bind --preset $argv \e\x20ep fish_clipboard_paste
end
set -e -g fish_cursor_selection_mode
end

View file

@ -305,6 +305,7 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
# After executing once, this will have defined functions listening for the variable.
# Therefore it needs to be before setting fish_bind_mode.
fish_vi_cursor
set -g fish_cursor_selection_mode inclusive
set fish_bind_mode $init_mode