Skip to content

Commit

Permalink
Update some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
pehlicd committed Sep 14, 2023
1 parent dd53e20 commit 9dd0d4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ func (tui *TUI) checkConn() error {
return nil
}

// Create a function to print errors
// Errorf Create a function to print errors
func (tui *TUI) Errorf(format string, args ...interface{}) {
tui.ClearPreviews()
tui.Preview.SetText(fmt.Sprintf("[red]"+format, args...)).SetTextAlign(tview.AlignLeft)
}

// Clear TUI previews
// ClearPreviews Clear TUI previews
func (tui *TUI) ClearPreviews() {
tui.PreviewList.Clear()
tui.Preview.Clear()
Expand Down
2 changes: 2 additions & 0 deletions pkg/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type TUI struct {
Config Config
}

// InitTUI Initialize TUI
func InitTUI() *TUI {
tui := TUI{App: tview.NewApplication()}

Expand Down Expand Up @@ -123,6 +124,7 @@ func InitTUI() *TUI {
return &tui
}

// Start starts TUI application
func (tui *TUI) Start() error {
return tui.App.SetRoot(tui.Grid, true).Run()
}

0 comments on commit 9dd0d4e

Please sign in to comment.