Skip to content

Commit

Permalink
syntax: fix uninitialized syntax-highlighting in bash-3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jun 27, 2022
1 parent dd358d7 commit 7bd03a5
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions lib/core-syntax-def.sh
Expand Up @@ -53,18 +53,6 @@ ble/util/autoload "$_ble_base/lib/core-syntax.sh" \
ble/syntax:bash/simple-word/is-simple \
ble/syntax:bash/simple-word/reconstruct-incomplete-word

#------------------------------------------------------------------------------
# 遅延読み込みの設定

# lib/core-syntax.sh の変数または ble/syntax/parse を使用する必要がある場合は、
# 以下の関数を用いて lib/core-syntax.sh を必ずロードする様にする。
function ble/syntax/import {
ble/util/import "$_ble_base/lib/core-syntax.sh"
}

ble/function#try ble/util/idle.push ble/syntax/import ||
ble/syntax/import

#------------------------------------------------------------------------------
# グローバル変数の定義 (関数内からではできないのでここで先に定義)

Expand All @@ -83,3 +71,17 @@ if ((_ble_bash>=40200||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
declare -A _ble_syntax_highlight_lscolors_ext=()
fi
fi

#------------------------------------------------------------------------------
# 遅延読み込みの設定

# lib/core-syntax.sh の変数または ble/syntax/parse を使用する必要がある場合は、
# 以下の関数を用いて lib/core-syntax.sh を必ずロードする様にする。
function ble/syntax/import {
ble/util/import "$_ble_base/lib/core-syntax.sh"
}

# Note: 初期化順序の都合で一番最後に実行する。lib/core-syntax 内で登録
# している ble/syntax/attr2iface/color_defface.onload は、上記で登録し
# ている ble/syntax/defface.onload よりも後に実行する必要がある為。
ble/function#try ble/util/idle.push ble/syntax/import || ble/syntax/import

0 comments on commit 7bd03a5

Please sign in to comment.