1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Move the utils.go file into the /utils directory

This commit is contained in:
Chris Cummer
2019-08-05 10:50:12 -07:00
parent 0bd2d176d8
commit 4e46fff145
57 changed files with 190 additions and 188 deletions

View File

@@ -5,7 +5,7 @@ import (
"github.com/rivo/tview"
"github.com/wtfutil/wtf/checklist"
"github.com/wtfutil/wtf/wtf"
"github.com/wtfutil/wtf/utils"
)
func (widget *Widget) display() {
@@ -54,5 +54,5 @@ func (widget *Widget) formattedItemLine(idx int, item *checklist.ChecklistItem,
tview.Escape(item.Text),
)
return wtf.HighlightableHelper(widget.View, row, idx, len(item.Text))
return utils.HighlightableHelper(widget.View, row, idx, len(item.Text))
}

View File

@@ -5,7 +5,7 @@ import (
"github.com/gdamore/tcell"
"github.com/wtfutil/wtf/cfg"
"github.com/wtfutil/wtf/wtf"
"github.com/wtfutil/wtf/utils"
)
func (widget *Widget) initializeKeyboardControls() {
@@ -50,7 +50,7 @@ func (widget *Widget) displayPrev() {
func (widget *Widget) openFile() {
confDir, _ := cfg.WtfConfigDir()
wtf.OpenFile(fmt.Sprintf("%s/%s", confDir, widget.filePath))
utils.OpenFile(fmt.Sprintf("%s/%s", confDir, widget.filePath))
}
func (widget *Widget) promoteSelected() {

View File

@@ -8,6 +8,7 @@ import (
"github.com/rivo/tview"
"github.com/wtfutil/wtf/cfg"
"github.com/wtfutil/wtf/checklist"
"github.com/wtfutil/wtf/utils"
"github.com/wtfutil/wtf/view"
"github.com/wtfutil/wtf/wtf"
"gopkg.in/yaml.v2"
@@ -108,7 +109,7 @@ func (widget *Widget) load() {
confDir, _ := cfg.WtfConfigDir()
filePath := fmt.Sprintf("%s/%s", confDir, widget.filePath)
fileData, _ := wtf.ReadFileBytes(filePath)
fileData, _ := utils.ReadFileBytes(filePath)
yaml.Unmarshal(fileData, &widget.list)