From 0f6a0834cbc0531dbe6873eeca43dcdb22c5c969 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 30 Aug 2021 22:28:15 +0900 Subject: [PATCH] edit: fix a bug that "command-help" does not work --- README.md | 2 +- memo/ChangeLog.md | 3 ++- note.txt | 12 ++++++++++++ src/edit.sh | 6 +++--- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c6034594..309c57c4 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ in some part of initialization and cleanup code, processing of large data in completions, paste of large data, etc. Pronunciation: The easiest pronunciation of `ble.sh` that users use is /blɛʃ/, but you can actually pronounce it as you like. -I do not specify no canonical way of pronoucing `ble.sh`. +I do not specify the canonical way of pronoucing `ble.sh`. In fact, I personally read it verbosely as /biːɛliː dɑt ɛseɪtʃ/ in my head. ## Quick instructions diff --git a/memo/ChangeLog.md b/memo/ChangeLog.md index 732fa5be..1a6947c2 100644 --- a/memo/ChangeLog.md +++ b/memo/ChangeLog.md @@ -122,6 +122,7 @@ - syntax: fix a bug that `eval() { :; }`, `declare() { :; }` are not treated as function definition `#D1529` b429095 - decode: fix a hang on attach failure by cache corruption `#D1531` 24ea379 - edit, etc: add workarounds for `localvar_inherit` `#D1532` 7b63c60 + - edit: fix a bug that `command-help` doesn't work `#D1635` 0000000 - progcomp: fix non-working `complete -C prog` (reported by Archehandoro) `#D1535` 026432d - bind: fix a problem that `bind '"seq":"key"'` causes a loop macro `bind -s key key` (reported by thanosz) `#D1536` ea05fc5 - bind: fix errors on readline macros (reported by RakibFiha) `#D1537` c257299 @@ -184,7 +185,7 @@ - util (`modifyOtherKeys`): update the workaround for a new quiark of kitty `#D1627` 3e4ecf5 - main: work around `set -B` and `set -k` `#D1628` a860769 - term: disable `modifyOtherKeys` and do not send `DA2` for `st` (requested by Shahabaz-Bagwan) `#D1632` 92c7b26 -- cmap: add `st`-specific escape sequences for cursor keys `#D1633` 0000000 +- cmap: add `st`-specific escape sequences for cursor keys `#D1633` acfb879 ## Internal changes and fixes diff --git a/note.txt b/note.txt index 529d3fa1..3b59b2e9 100644 --- a/note.txt +++ b/note.txt @@ -4916,6 +4916,18 @@ bash_tips 2021-08-30 + * edit: command-help が効かなくなっている [#D1635] + + どうやら以下の commit で external-command を書き換えた時に、内部で使用して + いる変数名 command と command-help で使用している変数名が被ってしまって問題 + が起こっている様だ。 + + 7b63c60d src/edit.sh (Koichi Murase 2021-05-06 16:04:39 +0900 8755) local command=$1 + + 一旦は command-help の側でコマンド名を他の変数に待避する様に書き換えてみた + が、うーん。そもそも external-command は呼び出し元の変数名に影響が無い様に + 特別な変数名を使うべきである。 + * README: やはり ble.sh の読み方を与えるべきかもしれない [#D1634] https://www.youtube.com/watch?v=YS1vxEhd2Pc diff --git a/src/edit.sh b/src/edit.sh index a23bba91..9518b11e 100644 --- a/src/edit.sh +++ b/src/edit.sh @@ -8749,8 +8749,8 @@ function ble/widget/internal-command { } function ble/widget/external-command { ble-edit/content/clear-arg - local command=$1 - [[ ${command//[$_ble_term_IFS]} ]] || return 1 + local _ble_local_command=$1 + [[ ${_ble_local_command//[$_ble_term_IFS]} ]] || return 1 ble/edit/enter-command-layout ble/textarea#invalidate @@ -8760,7 +8760,7 @@ function ble/widget/external-command { ble/canvas/bflush.draw ble/term/leave ble/util/buffer.flush >&2 - BASH_COMMAND=$command builtin eval -- "$command"; local ext=$? + BASH_COMMAND=$_ble_local_command builtin eval -- "$_ble_local_command"; local ext=$? ble/term/enter return "$ext" }