Skip to content
Myr

Fix misleading comment on printHeader nil-window guard

Before adoption: this commit came in with the history the project adopted, so no landing records it.

The guard fires when hasHeaderWindow() returned false at resize time, not when addInline had no budget (placeInlineStack always leaves a non-nil 0-height placeholder).

authored by Junegunn Choi · committed by Junegunn Choi · parent 01567b4 · Browse files · 1 file+6 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−4 removed

  • other:+6 added−4 removed

1 file+6 added−4 removed

modified:src/terminal.go+6 added-4 removed
3430 unmodified lines
3431 if !t.headerVisible {3432 return3433 }34343435 // When an inline section was requested but addInline had no budget, its window is3436 // nil. Don't fall through to withWindow — that would leak header content into the3437 // list window. A nil window is only legitimate when the shape is NOT inline (e.g.3438 // header combined with the list when --no-list-border is in effect).3435 // headerWindow is nil when hasHeaderWindow() returned false at resize time,3436 // e.g. --header-border=inline combined with empty header content. Don't3437 // delegate to printHeaderImpl because its nil-window branch folds the header3438 // into the list window, which isn't valid for inline. A nil window is only3439 // legitimate when the shape is NOT inline (e.g. header combined with the3440 // list when --no-list-border is in effect).3441 if !(t.headerBorderShape == tui.BorderInline && t.headerWindow == nil) {3442 t.withWindow(t.headerWindow, func() {3443 var headerItems []Item3444 if !t.hasHeaderLinesWindow() {
4743 unmodified lines