diff --git a/src/tui/light.go b/src/tui/light.go index bf2a2fd2..aaa9e56f 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -1159,9 +1159,16 @@ func (w *LightWindow) fill(str string, resetCode string) FillReturn { w.Move(w.posy+1, 0) w.renderer.stderr(resetCode) if len(lines) > 1 { - w.stderrInternal(DIM+w.wrapSign, false, resetCode) + sign := w.wrapSign + width := w.wrapSignWidth + if width > w.width-w.posx { + runes, truncatedWidth := util.Truncate(w.wrapSign, w.width-w.posx) + sign = string(runes) + width = truncatedWidth + } + w.stderrInternal(DIM+sign, false, resetCode) w.renderer.stderr(resetCode) - w.Move(w.posy, w.wrapSignWidth) + w.Move(w.posy, width) } } } diff --git a/src/tui/tcell.go b/src/tui/tcell.go index b70eed48..dffd235f 100644 --- a/src/tui/tcell.go +++ b/src/tui/tcell.go @@ -766,10 +766,18 @@ Loop: xPos := w.left + w.lastX + lx if xPos >= w.left+w.width { w.lastY++ + if w.lastY >= w.height { + return FillSuspend + } w.lastX = 0 lx = 0 xPos = w.left - wgr := uniseg.NewGraphemes(w.wrapSign) + sign := w.wrapSign + if w.wrapSignWidth > w.width { + runes, _ := util.Truncate(sign, w.width) + sign = string(runes) + } + wgr := uniseg.NewGraphemes(sign) for wgr.Next() { rs := wgr.Runes() _screen.SetContent(w.left+lx, w.top+w.lastY, rs[0], rs[1:], style.Dim(true))