MCPcopy
hub / github.com/wagoodman/dive / Render

Method Render

runtime/ui/view/filetree.go:418–445  ·  view source on GitHub ↗

Render flushes the state objects (file tree) to the pane.

()

Source from the content-addressed store, hash-verified

416
417// Render flushes the state objects (file tree) to the pane.
418func (v *FileTree) Render() error {
419 logrus.Tracef("view.Render() %s", v.Name())
420
421 title := v.title
422 isSelected := v.gui.CurrentView() == v.view
423
424 v.gui.Update(func(g *gocui.Gui) error {
425 // update the header
426 v.header.Clear()
427 width, _ := g.Size()
428 headerStr := format.RenderHeader(title, width, isSelected)
429 if v.vm.ShowAttributes {
430 headerStr += fmt.Sprintf(filetree.AttributeFormat+" %s", "P", "ermission", "UID:GID", "Size", "Filetree")
431 }
432 _, _ = fmt.Fprintln(v.header, headerStr)
433
434 // update the contents
435 v.view.Clear()
436 err := v.vm.Render()
437 if err != nil {
438 return err
439 }
440 _, err = fmt.Fprint(v.view, v.vm.Buffer.String())
441
442 return err
443 })
444 return nil
445}
446
447// KeyHelp indicates all the possible actions a user can take while the current pane is selected.
448func (v *FileTree) KeyHelp() string {

Callers 15

SetupMethod · 0.95
SetTreeMethod · 0.95
CursorDownMethod · 0.95
CursorUpMethod · 0.95
CursorLeftMethod · 0.95
CursorRightMethod · 0.95
PageDownMethod · 0.95
PageUpMethod · 0.95
toggleCollapseMethod · 0.95
toggleCollapseAllMethod · 0.95
toggleSortOrderMethod · 0.95
toggleWrapTreeMethod · 0.95

Calls 5

NameMethod · 0.95
RenderHeaderFunction · 0.92
UpdateMethod · 0.65
RenderMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected