mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 23:11:14 -03:00
Remove obsolete Vi mode delete key workaround
As reported in https://matrix.to/#/!YLTeaulxSDauOOxBoR:matrix.org/$n20_uqiMqatEQcPG79Ca0c2_YvHBHTr-yCVXTEuze_Y commitf5fac096c0(Don't move cursor in delete-char, 2017-04-19) fixed the behavior of Vi mode keys "delete" and "x" when the cursor is at the end of the buffer, and commitd51f669647(Vi mode: avoid placing cursor beyond last character, 2024-02-14) generalized this fix. This means that the delete-specific fix is no longer necessary. Remove it. Note that if the cursor is at end of a line but not the last line, the behavior of "delete" in Vi mode is still wrong. It should stay on the line.
This commit is contained in:
@@ -113,13 +113,10 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||
bind -s --preset -M insert end end-of-line
|
||||
bind -s --preset -M default end end-of-line
|
||||
|
||||
# Vi moves the cursor back if, after deleting, it is at EOL.
|
||||
# To emulate that, move forward, then backward, which will be a NOP
|
||||
# if there is something to move forward to.
|
||||
bind -s --preset -M default x delete-char 'set fish_cursor_end_mode exclusive' forward-single-char backward-char 'set fish_cursor_end_mode inclusive'
|
||||
bind -s --preset -M default x delete-char
|
||||
bind -s --preset -M default X backward-delete-char
|
||||
bind -s --preset -M insert delete delete-char forward-single-char backward-char
|
||||
bind -s --preset -M default delete delete-char 'set fish_cursor_end_mode exclusive' forward-single-char backward-char 'set fish_cursor_end_mode inclusive'
|
||||
bind -s --preset -M insert delete delete-char
|
||||
bind -s --preset -M default delete delete-char
|
||||
|
||||
# Backspace deletes a char in insert mode, but not in normal/default mode.
|
||||
bind -s --preset -M insert backspace backward-delete-char
|
||||
|
||||
Reference in New Issue
Block a user