mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00: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 |
||
---|---|---|
.. | ||
checks | ||
pexpects | ||
test_functions | ||
.gitignore | ||
filter-control-sequences.sh | ||
history_sample_bash | ||
history_sample_corrupt1 | ||
history_sample_fish_1_x | ||
history_sample_fish_2_0 | ||
interactive.config | ||
interactive.fish | ||
test.fish | ||
test_driver.sh | ||
test_env.sh | ||
test_util.fish |