Skip to content

Commit

Permalink
histdb: support "bleopt histdb_remarks"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Feb 19, 2023
1 parent a125187 commit adaec05
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contrib
Submodule contrib updated 2 files
+108 −30 histdb.bash
+58 −40 prompt-git.bash
2 changes: 2 additions & 0 deletions docs/ChangeLog.md
Expand Up @@ -561,6 +561,8 @@
- histdb: fix remaining debug function name "assign{2 => }" in bash <= 3.2 `#D1953` xxxxxxx
- histdb: fix a problem that the background process fails to start in bash-3.0 `#D1956` xxxxxxx
- histdb: fix a bug that history search fails with a single quote in the commandline `#D1957` xxxxxxx
- histdb: fix `histdb-word` completions in the middle of the commandline `#D1968` xxxxxxx
- histdb: support `bleopt histdb_remarks` `#D1968` xxxxxxx
- integration: move `fzf` and `bash-preexec` integrations to subdir `#D1939` 86d9467

<!---------------------------------------------------------------------------->
Expand Down
3 changes: 1 addition & 2 deletions lib/vim-airline.sh
Expand Up @@ -247,8 +247,7 @@ function ble/prompt/backslash:lib/vim-airline/mode {
function ble/prompt/backslash:lib/vim-airline/gitstatus {
local "${_ble_contrib_prompt_git_vars[@]/%/=}" # WA #D1570 checked
if ble/contrib/prompt-git/initialize; then
local hash branch
ble/contrib/prompt-git/get-head-information
ble/contrib/prompt-git/update-head-information
if [[ $branch ]]; then
ble/prompt/print "$bleopt_vim_airline_symbol_branch$branch"
elif [[ $hash ]]; then
Expand Down
50 changes: 50 additions & 0 deletions note.txt
Expand Up @@ -1374,6 +1374,10 @@ bash_tips
bug-bash, third-party bugs & reviews
-------------------------------------------------------------------------------

2023-02-14

* bug-bash: bash-5.2 で -u extquote しても ${var//[$'\n']} が改行を削除する。

2023-02-06

* bug-bash: 実は colored-stats は本来 LS_COLORS を反映するらしい。然し、
Expand Down Expand Up @@ -1932,6 +1936,12 @@ bash_tips
- leakvars
- keymap の移動 (これは別 commit にする?)

2023-02-14

* no-argument return がまたある。make scan でチェックするべき。

$ grc 'return[[:space:]]*($|[;|&])'

2023-02-12

* syntax: 5.0 以降では関数名として function `xxx` 等も実は許されている。5.3
Expand Down Expand Up @@ -6647,6 +6657,46 @@ bash_tips

2023-02-14

* histdb: git info 等追加情報を user の指定で記録できる様にする [#D1969]
→ "bleopt histdb_remarks" として実装した。

2023-02-18 そもそも rps1 での dirty 更新が発生していない。因みに
prompt_status_line に関しては dirty 更新は働いている様だ。然し、これは独立
した問題の気がする。

うーん。mintty の中だけでなく、普通に新しいセッションでは全て動いていない。
何故? うーん。histdb_remarks の対応 commit で以降で動かなくなっている。→同
期処理等を破壊したかと思ったが単に dirty_mark の生成コードでバグを埋め込ん
でいただけだった。

* histdb: PS1=(\$ ' で ( を挿入した時にエラーメッセージ [#D1968]

これは master 81e376a (もう存在していない。対応するのは 8d5cab8 が近い) で
は発生していない。

これは最初は syntax のバグかと思ったがどうやら histdb-word で発生している。

うーん。response で現在のコマンド内容と全く関係ない物が生成されている? とい
うかそもそも空の文字列で候補生成されているのではないか。然し、そうだとして
も index が 8 になっているのはよく分からない。

_ble_edit_str='PS1=(\$ '\''' len=9
_ble_edit_ind="5"
ret="8:'.timeout 1001'" # response

うーん。分かった request の時点で全ての単語に対して補完を試みようとしている。
何故かというと現在のカーソル位置がコマンドラインの末端にあるという事を仮定
している。

カーソルが行の途中にある場合には個別に実装する必要があるのではないか。と思っ
たが、カーソルが単語の途中にある時にはその単語について補間する必要はない。
飽くまで単語の末尾にいる時にだけ補完を実行すれば良い。行の途中にいてかつ単
語の末尾にいるという状況では、まだ閉じていない単語の末尾にいるという事はあ
りえない。という事は、現在位置にある単語について調べれば十分である。

うーん。現在の単語の開始位置を調べる方法が非自明だったが (wbegin を stat に
設置せずに一気に読み取ってしまう単語が存在する) 取り敢えず実装した。

* blerc.template: update unicode versions [#D1967]

2023-02-13
Expand Down

0 comments on commit adaec05

Please sign in to comment.