Skip to content

Commit

Permalink
decode (rlfunc): update mapping "vi-replace" in "imap" and "vi-editin…
Browse files Browse the repository at this point in the history
…g-mode" in "nmap"
  • Loading branch information
akinomyoga committed Feb 21, 2021
1 parent 3559658 commit f2ca811
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
1 change: 1 addition & 0 deletions keymap/vi.sh
Expand Up @@ -7566,6 +7566,7 @@ function ble/widget/vi_imap/delete-region-or {
fi
}
function ble/widget/vi_imap/overwrite-mode {
ble-edit/content/clear-arg
if [[ $_ble_edit_overwrite_mode ]]; then
_ble_edit_overwrite_mode=
else
Expand Down
2 changes: 1 addition & 1 deletion keymap/vi_imap.rlfunc.txt
Expand Up @@ -152,7 +152,7 @@ vi-overstrike-delete -
vi-prev-word -
vi-put -
vi-redo -
vi-replace -
vi-replace vi_imap/overwrite-mode
vi-rubout -
vi-search -
vi-search-again -
Expand Down
2 changes: 1 addition & 1 deletion keymap/vi_nmap.rlfunc.txt
Expand Up @@ -139,7 +139,7 @@ vi-column vi-command/nth-column
vi-complete -
vi-delete vi_nmap/kill-forward-char
vi-delete-to vi-rlfunc/delete-to
vi-editing-mode -
vi-editing-mode vi_nmap/insert-mode
vi-eof-maybe vi-rlfunc/eof-maybe
vi-fetch-history vi-command/history-end
vi-first-print vi-command/first-non-space
Expand Down
3 changes: 2 additions & 1 deletion memo/ChangeLog.md
Expand Up @@ -32,6 +32,7 @@
- prompt: rename `bleopt prompt_{status_line => term_status}` `#D1462` cca1cbc
- edit (`ble/builtin/read`): cancel by <kbd>C-d</kbd> on an empty line `#D1473` ecb8888
- syntax: change syntax context after `time ;` and `! ;` for Bash 4.4 `#D1477` 4628370
- decode (rlfunc): update mapping `vi-replace` in `imap` and `vi-editing-mode` in `nmap` (reported by onelittlehope) `#D1484` 0000000

## Fixes

Expand All @@ -53,7 +54,7 @@
- bind: work around broken `cmd_xmap` after switching the editing mode `#D1478` 8d354c1
- edit: clear graphic rendition on newlines and external commands `#D1479` 18bb2d5
- mandb: improve extraction and cache for each locale `#D1480` 3588158
- decode (rlfunc): work around incomplete bytes in keyseq (reported by onelittlehope) `#D1483` 0000000
- decode (rlfunc): work around incomplete bytes in keyseq (reported by onelittlehope) `#D1483` 3559658

## Internal changes and fixes

Expand Down
37 changes: 37 additions & 0 deletions note.txt
Expand Up @@ -3730,6 +3730,43 @@ bash_tips

2021-02-21

* decode (rlfunc): vi-replace in imap, vi-editing-mode in nmap (reported by onelittlehope) [#D1484]

それから vi-replace in imap 及び vi-editing-mode in nmap は未実装である。

* vi-editin-mode in nmap: 先ずは vi-editing-mode を vi-command で使うと何が
起こるのかについて確認する。→どうやら vi_nmap を抜けて imap に戻る様であ
る。うーん。これは単に vi_nmap/insert-mode にすれば良い気がする。

* vi-replace はどうやら replace-mode に入る為のコマンドの様だ。そしてこれは
insert と同じで良いのではないか?? と思ったがうーん。vi-command では "R"
に割り当てられている。つまり、文字幅に応じた replace-mode に入るべきであ
る。

| vi_imap でも同等の replace-mode に入るための widget を追加するべきだろう
| か。と思って、vi_imap/normal-mode-without-insert-leave &
| vi_nmap/replace-mode を組み合わせて新しい widget を作りかけていたら、どう
| やら既に存在していた様だ。vi_imap/overwrite-mode である。というより、既定
| の insert がこれになっていた。
|
| なので作りかけた以下の関数は廃止。
|
| function ble/widget/vi_imap/replace-mode {
| ble-edit/content/clear-arg
| _ble_edit_mark_active=
| _ble_edit_overwrite_mode=R
| _ble_keymap_vi_insert_overwrite=R
| ble/keymap:vi/update-mode-name
| }

所で、既存の vi_imap/overwrite-mode は ble-edit/content/clear-arg がない
が良いのだろうか。と思ったが、よく考えたら vi_imap では引数を指定する方法
が存在しない。という事を考えたら別になくても良いという事なのだろうか。ま
あ、ble-edit/content/clear-arg して困る事はない。もしかすると誰かが
vi_imap でも arg を設定できる様に binding を追加するかもしれない。

結局二つとも既存の widget を辞書に登録するだけで済ませる事にした。

* decode (rlfunc): 既存の束縛の読み取り時にエラー (reported by onelittlehope) [#D1483]
https://github.com/akinomyoga/ble.sh/issues/89

Expand Down

0 comments on commit f2ca811

Please sign in to comment.