Skip to content

Commit

Permalink
edit: support bash-5.2 "READLINE_ARGUMENT"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Sep 3, 2021
1 parent 2365e09 commit d347fb3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions memo/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
- complete: add a new option `bleopt complete_limit_auto_menu` `#D1618` 1829d80
- rlfunc: support vi word operations in `emacs` keymap (requested by SolarAquarion) `#D1624` 21d636a
- edit: support `TMOUT` for the session timeout `#D1631` 0e16dbd
- edit: support bash-5.2 `READLINE_ARGUMENT` `#D1638` 0000000

## Changes

Expand Down
9 changes: 8 additions & 1 deletion note.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2040,7 +2040,7 @@ bash_tips

2021-05-03

* rlfunc: C-x s spell-correct-word
* rlfunc: C-x s, spell-correct-word
* rlvar: enable-active-region
* rlbind: prior, next
* vi-undo
Expand Down Expand Up @@ -4991,6 +4991,13 @@ bash_tips

2021-09-01

* 2021-05-03 edit: support bash-5.2 READLINE_ARGUMENT [#D1638]

5.2 新機能: READLINE_ARGUMENT: 調べてみると引数が存在している時にのみ定義さ
れる様である。また今気づいた事だが -x 属性が入っている。他の READLINE_* も
全て同様である。よく考えてみれば、bind -x で外部コマンドを呼び出す事もある
のだから -x 属性が入っていないと困る。

* 2021-08-23 mandb: manpath コマンドを使っても MANPATH は得られる [#D1637]

また、MANPATH に空パスが含まれている場合にはそれは標準の manpath と解釈される様だ。
Expand Down
8 changes: 5 additions & 3 deletions src/edit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8785,9 +8785,11 @@ function ble/widget/.SHELL_COMMAND { ble/widget/execute-command "$@"; }
## ble-bind -x で登録されたコマンドを処理します。
function ble/widget/.EDIT_COMMAND {
local command=$1
local READLINE_LINE=$_ble_edit_str
local READLINE_POINT=$_ble_edit_ind
local READLINE_MARK=$_ble_edit_mark
local -x READLINE_LINE=$_ble_edit_str
local -x READLINE_POINT=$_ble_edit_ind
local -x READLINE_MARK=$_ble_edit_mark
[[ $_ble_edit_arg ]] &&
local -x READLINE_ARGUMENT=$_ble_edit_arg
ble/widget/.hide-current-line
ble/util/buffer.flush >&2
builtin eval -- "$command" || return 1
Expand Down

0 comments on commit d347fb3

Please sign in to comment.