mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-05 05:11:15 -03:00
Migrate abbrs from =-separated to space-separated
We silently upgrade existing abbreviations and change the separator when saving. This does not yet warn when the user is using the old syntax. Resolves #2051
This commit is contained in:
committed by
Kurtis Rader
parent
fbd53f2da1
commit
0e8a8a7c80
@@ -165,3 +165,14 @@ for file in $configdir/fish/conf.d/* $__fish_sysconfdir/conf.d/* $__fish_datadir
|
||||
# This allows one to use e.g. symlinks to /dev/null to "mask" something (like in systemd)
|
||||
[ -f $file -a -r $file ]; and source $file
|
||||
end
|
||||
|
||||
# Upgrade pre-existing abbreviations from the old "key=value" to the new "key value" syntax
|
||||
# This needs to be in share/config.fish because __fish_config_interactive is called after sourcing config.fish, which might contain abbr calls
|
||||
if not set -q __fish_init_2_3_0
|
||||
set -l fab
|
||||
for abb in $fish_user_abbreviations
|
||||
set fab $fab (string replace -r '^([^ =]+)=(.*)$' '$1 $2' -- $abb)
|
||||
end
|
||||
set fish_user_abbreviations $fab
|
||||
set -U __fish_init_2_3_0
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user