(g *gocui.Gui, view string)
| 464 | } |
| 465 | |
| 466 | func (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 | |
| 488 | func (ui *UI) createPopupView(g *gocui.Gui, viewname string, w, h int) (*gocui.View, error) { |
| 489 | maxX, maxY := g.Size() |
no test coverage detected