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

Todo and TextFile have keyboard short-cut to open file in OS

This commit is contained in:
Chris Cummer
2018-04-24 11:00:59 -07:00
parent 42559c396d
commit ed52835650
3 changed files with 36 additions and 0 deletions

View File

@@ -61,6 +61,14 @@ func NamesFromEmails(emails []string) []string {
return names
}
func OpenFile(path string) {
confDir, _ := ConfigDir()
filePath := fmt.Sprintf("%s/%s", confDir, path)
cmd := exec.Command("open", filePath)
ExecuteCommand(cmd)
}
// PadRow returns a padding for a row to make it the full width of the containing widget.
// Useful for ensurig row highlighting spans the full width (I suspect tcell has a better
// way to do this, but I haven't yet found it)