Skip to content

Commit

Permalink
menu-complete (menu-style:linewise): fix clipping of long line
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Apr 2, 2023
1 parent 2eadcd5 commit 4c6a477
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/ChangeLog.md
Expand Up @@ -381,6 +381,7 @@
- keymap/vi (`operator:filter`): do not append newline at the end of line `#D1994` bce2033
- highlight: fix shifted error marks after delayed `core-syntax` `#D2000` f4145f16
- syntax: fix unrecognized variable assignment of the form `echo arr[i]+=rhs` `#D2007` 41faa494
- menu (linewise): fix clipping of long line (reported by bkerin) `#D2025` xxxxxxxx

## Documentation

Expand Down
5 changes: 3 additions & 2 deletions lib/core-complete.sh
Expand Up @@ -407,8 +407,9 @@ function ble/complete/menu-style:linewise/construct-page {
((x=prefix_width))

((x0=x,y0=y))
lines=1 cols=$max_icon_width y=0 ble/complete/menu#render-item "$item"; esc1=$ret
_ble_complete_menu_style_icons[index]=$x0,$y0,$x,$y,${#item},${#esc1}:$item$esc1
local lines1=1 cols1=$max_icon_width
lines=$lines1 cols=$cols1 y=0 ble/complete/menu#render-item "$item"; esc1=$ret
_ble_complete_menu_style_icons[index]=$x0,$y0,$x,$y,${#item},${#esc1},"$x0 0 $cols1 $lines1":$item$esc1
((index++))
esc=$esc$esc1

Expand Down
16 changes: 16 additions & 0 deletions note.txt
Expand Up @@ -6714,6 +6714,22 @@ bash_tips
Done (実装ログ)
-------------------------------------------------------------------------------

2023-03-26

* menu-complete (linewise): 長い行がある時に表示が崩れる (reported by bkerin) [#D2025]
https://github.com/akinomyoga/ble.sh/issues/307

これは実装を詳しく調べてみたら選択時の部分更新の時の幾何を記録する部分で、
描画範囲を限定した時の記録が残っていないのが原因だった。そもそも linewise
は試験的に最初に実装したもので余り真面目に実装されていない感じがする。その
後で desc の実装でもっとちゃんと実装されてその時に限定された描画範囲につい
てちゃんと対応が行われている。その desc に使われた仕組みを linewise からも
使うだけで良かった。

然しそれとは別に長い候補を入力した時に panel の高さが変わった時に menu の高
さを制限した上で再描画を行う仕組みが欲しい。これについては簡単ではなさそう
なので別の項目で議論する事にする。

2023-03-16

* edit: bind -x で PS1 も一時的に復元する (requested by adoyle-h) [#D2024]
Expand Down

0 comments on commit 4c6a477

Please sign in to comment.