Skip to content

Commit

Permalink
edit: fix layout with rps1 caused by missing opts=relative for textmap
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jul 7, 2022
1 parent 4179e3d commit e799191
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/canvas.sh
Expand Up @@ -1264,9 +1264,10 @@ function ble/textmap#update/.wrap {
}

## 関数 ble/textmap#update text [opts]
## @var[in ] text
## @var[in,out] x y
## @var[in,out] _ble_textmap_*
## @param[in] text
## @param[in,opt] opts
## @var[in,out] x y
## @var[in,out] _ble_textmap_*
function ble/textmap#update {
local IFS=$' \t\n'
local dbeg dend dend0
Expand Down
10 changes: 8 additions & 2 deletions src/edit.sh
Expand Up @@ -2096,8 +2096,14 @@ function ble/textarea#clear-state {
# **** redraw, clear-screen, etc **** @widget.clear

function ble/widget/.update-textmap {
local text=$_ble_edit_str x=$_ble_textmap_begx y=$_ble_textmap_begy
ble/textmap#update "$text"
local cols=${COLUMNS:-80} render_opts=
if [[ $_ble_edit_rprompt ]]; then
local rps1_width=${_ble_edit_rprompt_bbox[2]}
render_opts=relative
((cols-=rps1_width+1,_ble_term_xenl||cols--))
fi
local x=$_ble_textmap_begx y=$_ble_textmap_begy
COLUMNS=$cols ble/textmap#update "$_ble_edit_str" "$render_opts"
}
function ble/widget/redraw-line {
ble-edit/content/clear-arg
Expand Down

0 comments on commit e799191

Please sign in to comment.