1
0
Fork 0

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
Mike Gerwitz 2014-08-27 19:15:32 -04:00
parent 0b94d4da50
commit c2d3c6eb87
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
1 changed files with 1 additions and 1 deletions

View File

@ -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