Skip to content

Commit

Permalink
global: fix declaration of associative arrays for "ble-reload"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Feb 9, 2021
1 parent 8856a04 commit 3cae6e4
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/core-complete-def.sh
Expand Up @@ -18,6 +18,7 @@ function ble-sabbrev {
}

if ! declare -p _ble_complete_sabbrev &>/dev/null; then # reload #D0875
builtin unset -v _ble_complete_sabbrev
if ((_ble_bash>=40300)); then
declare -gA _ble_complete_sabbrev=()
elif ((_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
Expand Down
2 changes: 2 additions & 0 deletions lib/core-syntax-def.sh
Expand Up @@ -100,6 +100,8 @@ bleopt/declare -v highlight_filename 1
bleopt/declare -v highlight_variable 1

if ((_ble_bash>=40300||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
builtin unset -v _ble_syntax_highlight_filetype
builtin unset -v _ble_syntax_highlight_lscolors_ext
if ((_ble_bash>=40300)); then
declare -gA _ble_syntax_highlight_filetype=()
declare -gA _ble_syntax_highlight_lscolors_ext=()
Expand Down
3 changes: 2 additions & 1 deletion memo/ChangeLog.md
Expand Up @@ -31,7 +31,8 @@
- edit (sword): fix definition of `sword` (shell words) `#D1441` f923388
- edit (`kill-forward-logical-line`): fix a bug not deleting newline at the end of the line `#D1443` 09cf7f1
- complete (mandb): fix an encoding prpblem of utf8 manuals `#D1446` 7a4a480
- global:work around bash-4.2 bug of `declare -gA` (reported by 0xC0ncord) `#D1470` 0000000
- global:work around bash-4.2 bug of `declare -gA` (reported by 0xC0ncord) `#D1470` 8856a04
- global: fix declaration of associative arrays for `ble-reload` `#D1471` 0000000

## Internal changes and fixes

Expand Down
7 changes: 7 additions & 0 deletions note.txt
Expand Up @@ -3725,6 +3725,13 @@ bash_tips

2021-02-10

* global: 今度はまた別の連想配列のエラーが出ている (reported by 0xC0ncord) [#D1471]
https://github.com/akinomyoga/ble.sh/issues/86#issuecomment-776165286

新しいシェルを開いてもエラーが出ていると書いているが本当だろうか?
もしこれが同じシェルだとしたら ble-update で駄目な事になるというのは理解できる。
取り敢えずその為の修正だけは入れる事にした。

* global: 連想配列の中身が bash-4.2 関数内ble.shソースで消滅する (reported by 0xC0ncord) [#D1470]
https://github.com/akinomyoga/ble.sh/issues/86

Expand Down
1 change: 1 addition & 0 deletions src/decode.sh
Expand Up @@ -117,6 +117,7 @@ _ble_decode_FunctionKeyBase=0x110000
if ((_ble_bash>=40300||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
_ble_decode_kbd_ver=4
_ble_decode_kbd__n=0
builtin unset -v _ble_decode_kbd__k2c
if ((_ble_bash>=40300)); then
declare -gA _ble_decode_kbd__k2c=()
else
Expand Down
1 change: 1 addition & 0 deletions src/history.sh
Expand Up @@ -780,6 +780,7 @@ if [[ ! ${_ble_builtin_history_initialized+set} ]]; then
## @param[in] file
##
if ((_ble_bash>=40300||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
builtin unset -v _ble_builtin_history_rskip_dict
if ((_ble_bash>=40300)); then
declare -gA _ble_builtin_history_rskip_dict=()
else
Expand Down
1 change: 1 addition & 0 deletions src/util.sh
Expand Up @@ -1373,6 +1373,7 @@ _ble_builtin_trap_handlers=()
_ble_builtin_trap_DEBUG=
_ble_builtin_trap_inside=
if ((_ble_bash>=40300||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
builtin unset -v _ble_builtin_trap_n2i
if ((_ble_bash>=40300)); then
declare -gA _ble_builtin_trap_n2i=()
else
Expand Down

0 comments on commit 3cae6e4

Please sign in to comment.