From 5d85238dfdccd78cbcdd02eb0235e889cea57d7f Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Fri, 28 May 2021 10:56:30 +0900 Subject: [PATCH] sabbrev (ble-sabbrev): fix delayed output before the initialization --- lib/core-complete-def.sh | 13 +++++++++++++ memo/ChangeLog.md | 1 + note.txt | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/lib/core-complete-def.sh b/lib/core-complete-def.sh index 5c294ab2..df292083 100644 --- a/lib/core-complete-def.sh +++ b/lib/core-complete-def.sh @@ -13,6 +13,19 @@ ble/util/autoload "$_ble_base/lib/core-complete.sh" \ ble/widget/dabbrev-expand function ble-sabbrev { + # check arguments for printing + local arg print= + for arg; do + if [[ $arg != -* && $arg != *=* ]]; then + print=1 + break + fi + done + if (($#==0)) || [[ $print ]]; then + ble-import lib/core-complete && ble-sabbrev "$@" + return $? + fi + local ret; ble/string#quote-command "$FUNCNAME" "$@" blehook/eval-after-load complete "$ret" } diff --git a/memo/ChangeLog.md b/memo/ChangeLog.md index e401b6b1..08a1fca7 100644 --- a/memo/ChangeLog.md +++ b/memo/ChangeLog.md @@ -119,6 +119,7 @@ - Makefile: create `run` directory instead of `tmp` `#D1557` 9bdb37d - main: fix the workaround for `set -e` `#D1564` ab2f70b - util: work around bash-3.0 bug `"${scal[@]/xxx}"` `#D1570` 0000000 +- sabbrev (`ble-sabbrev`): fix delayed output before the initialization `#D1573` 0000000 ## Compatibility diff --git a/note.txt b/note.txt index df334720..454d6a30 100644 --- a/note.txt +++ b/note.txt @@ -4653,6 +4653,15 @@ bash_tips Done (実装ログ) ------------------------------------------------------------------------------- +2021-05-28 + + * ble-sabbrev の初期化遅延で内容出力迄も遅延されている (bash-3.*) [#D1573] + + ble-sabbrev の初期化を遅延しているが、内容確認の為の ble-sabbrev ですら遅延 + されて、ロードした時になってから内容が出力される。この振る舞いは修正するべ + きである。然し、これを検出する為には、ble-sabbrev の一時実装の側で引数を解 + 析する必要がある。 + 2021-05-27 * canvas: 変数リークしている (buff, trap, {x,y}{1,2}) [#D1572]