MCPcopy
hub / github.com/jesseduffield/lazygit / InnerWidth

Method InnerWidth

pkg/gocui/view.go:531–538  ·  view source on GitHub ↗

The writeable area of the view is always two less then the view's size, because if it has a frame, we need to subtract that, but if it doesn't, the view is made 1 larger on all sides. I'd like to clean this up at some point, but for now we live with this weirdness.

()

Source from the content-addressed store, hash-verified

529// view is made 1 larger on all sides. I'd like to clean this up at some point,
530// but for now we live with this weirdness.
531func (v *View) InnerWidth() int {
532 innerWidth := v.Width() - 2
533 if innerWidth < 0 {
534 return 0
535 }
536
537 return innerWidth
538}
539
540func (v *View) InnerHeight() int {
541 innerHeight := v.Height() - 2

Callers 15

TestWrapViewLinesToWidthFunction · 0.95
SetViewMethod · 0.95
InnerSizeMethod · 0.95
parseInputMethod · 0.95
RenderTextAreaMethod · 0.95
formatBindingInfosMethod · 0.80
newPtyTaskMethod · 0.80
newPtyTaskMethod · 0.80
GetOnRenderToMainMethod · 0.80
GetOnRenderToMainMethod · 0.80
ExplodeMethod · 0.80

Calls 1

WidthMethod · 0.95

Tested by 1

TestWrapViewLinesToWidthFunction · 0.76