mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-29 13:23:53 +08:00
00432df420
On a; we don't expand the abbreviation because the cursor is right of semicolon, not on the command token. Fix this by making sure that we call expand-abbr with the cursor on the semicolon which is the end of the command token. (Now that our bind command execution order is less surprising, this is doable.) This means that we need to fix the cursor after successfully expanding an abbreviation. Do this by setting the position explicitly even when no --set-position is in effect. An earlier version of this patch used bind space self-insert backward-char expand-abbr or forward-char The problem with that (as a failing test shows) was that given "abbr m myabbr", after typing "m space ctrl-z", the cursor would be after the "m", not after the space. The second space removes the space, not changing the cursor position, which is weird. I initially tried to fix this by adding a hack to the undo group logic, to always restore the cursor position from when begin-undo-group was used. bind space self-insert begin-undo-group backward-char expand-abbr end-undo-group or forward-char However this made test_torn_escapes.py fail for mysterious reasons. I believe this is because that test registers and triggers a SIGUSR1 handler; since the signal handler will rearrange char events, that probably messes with the undo group guards. I resorted to adding a tailor-made readline cmd. We could probably remove it and give the new behavior to expand-abbr, not sure. Fixes #9730 |
||
---|---|---|
.. | ||
abbrs.py | ||
bind_mode_events.py | ||
bind.py | ||
cancel_event.py | ||
commandline.py | ||
complete-group-order.py | ||
complete.py | ||
cursor_selection.py | ||
disable_mouse.py | ||
eval-stack-overflow.py | ||
exit_handlers.py | ||
exit_nohang.py | ||
exit.py | ||
fg.py | ||
fkr.py | ||
generic.py | ||
histfile.py | ||
history.py | ||
isatty.py | ||
job_summary.py | ||
nullterm.py | ||
pipeline.py | ||
postexec.py | ||
private_mode.py | ||
read.py | ||
set_color.py | ||
sigint.py | ||
signals.py | ||
status.py | ||
stdin_nonblocking.py | ||
terminal.py | ||
torn_escapes.py | ||
tty_ownership.py | ||
undo.py | ||
wait.py | ||
wildcard_tab.py |