mirror of
https://github.com/junegunn/fzf.git
synced 2026-04-27 09:41:31 +08:00
Redraw when change-header changes line count
The inline header slot's row budget depends on header content length, but resizeIfNeeded() tolerates a shorter-than-wanted inline window, so the stale slot stays. Drive a redraw on length change to re-run the layout.
This commit is contained in:
+9
-3
@@ -6781,10 +6781,16 @@ func (t *Terminal) Loop() error {
|
||||
t.cx = len(t.input)
|
||||
case actChangeHeader, actTransformHeader, actBgTransformHeader:
|
||||
capture(false, func(header string) {
|
||||
// When a dedicated header window is not used, we may need to
|
||||
// update other elements as well.
|
||||
if t.changeHeader(header) {
|
||||
req(reqList, reqPrompt, reqInfo)
|
||||
// resizeIfNeeded() tolerates a shorter-than-wanted inline
|
||||
// window, so a length change can leave the inline slot
|
||||
// stale. Force a redraw to re-run the layout. Non-inline
|
||||
// shapes are handled by resizeIfNeeded.
|
||||
if t.headerBorderShape == tui.BorderInline {
|
||||
req(reqRedraw)
|
||||
} else {
|
||||
req(reqList, reqPrompt, reqInfo)
|
||||
}
|
||||
}
|
||||
req(reqHeader)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user