MCPcopy
hub / github.com/liamg/darktile / resizeView

Method resizeView

internal/app/darktile/termutil/resize.go:71–93  ·  view source on GitHub ↗

deprecated

(width uint16, height uint16)

Source from the content-addressed store, hash-verified

69
70// deprecated
71func (buffer *Buffer) resizeView(width uint16, height uint16) {
72
73 if buffer.viewHeight == 0 {
74 buffer.viewWidth = width
75 buffer.viewHeight = height
76 return
77 }
78
79 // scroll to bottom
80 buffer.scrollLinesFromBottom = 0
81
82 if width < buffer.viewWidth { // wrap lines if we're shrinking
83 buffer.shrink(width)
84 buffer.grow(width)
85 } else if width > buffer.viewWidth { // unwrap lines if we're growing
86 buffer.grow(width)
87 }
88
89 buffer.viewWidth = width
90 buffer.viewHeight = height
91
92 buffer.resetVerticalMargins(uint(buffer.viewHeight))
93}

Callers 5

TestHorizontalResizeViewFunction · 0.80
TestShrinkingThenGrowingFunction · 0.80
SetSizeMethod · 0.80
switchBufferMethod · 0.80

Calls 3

shrinkMethod · 0.95
growMethod · 0.95
resetVerticalMarginsMethod · 0.95

Tested by 3

TestHorizontalResizeViewFunction · 0.64
TestShrinkingThenGrowingFunction · 0.64