MCPcopy
hub / github.com/qustavo/httplab / setView

Method setView

ui/ui.go:466–486  ·  view source on GitHub ↗
(g *gocui.Gui, view string)

Source from the content-addressed store, hash-verified

464}
465
466func (ui *UI) setView(g *gocui.Gui, view string) error {
467 if err := ui.closePopup(g, ui.currentPopup); err != nil {
468 return err
469 }
470
471 // Save cursor position before switch view
472 cur := g.CurrentView()
473 x, y := cur.Cursor()
474 ui.cursors.Set(cur.Name(), x, y)
475
476 if _, err := g.SetCurrentView(view); err != nil {
477 return err
478 }
479
480 if ui.AutoUpdate && ui.hasChanged {
481 ui.hasChanged = false
482 return ui.updateResponse(g)
483 }
484
485 return nil
486}
487
488func (ui *UI) createPopupView(g *gocui.Gui, viewname string, w, h int) (*gocui.View, error) {
489 maxX, maxY := g.Size()

Callers 5

InitMethod · 0.95
nextViewMethod · 0.95
prevViewMethod · 0.95
closePopupMethod · 0.95
openPopupMethod · 0.95

Calls 3

closePopupMethod · 0.95
updateResponseMethod · 0.95
SetMethod · 0.80

Tested by

no test coverage detected