Skip to content

Commit

Permalink
edit: fix a bug that "command-help" does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Aug 31, 2021
1 parent 5fd4f30 commit 0f6a083
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion memo/ChangeLog.md
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions note.txt
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/edit.sh
Expand Up @@ -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
Expand All @@ -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"
}
Expand Down

0 comments on commit 0f6a083

Please sign in to comment.