shortmap vars now globally declared
There are two things that are required for this to work properly: - The `-g` flag to `declare`, ensuring that the shortmap data will be accessible even if this script is sourced from within a function; and - Omitting the assignment in the declaration; Bash seems to have a bug whereby associative arrays initialized in that manner will not be global.master
parent
0b94d4da50
commit
c2d3c6eb87
|
@ -145,7 +145,7 @@ __git-short_load_maps()
|
|||
|
||||
|
||||
declare shortcmd comp cmd
|
||||
declare -A __git_short_maps=() __git_short_comp=()
|
||||
declare -gA __git_short_maps __git_short_comp
|
||||
|
||||
# register each shortmap
|
||||
while read shortcmd comp cmd; do
|
||||
|
|
Loading…
Reference in New Issue