editor can open file from fst cmd arg

This commit is contained in:
Felix Angell 2018-04-13 17:59:10 +01:00
parent 23e74e1f16
commit 69bd7535b9
3 changed files with 9 additions and 2 deletions

View File

@ -52,8 +52,6 @@ func NewBuffer(conf *cfg.TomlConfig) *Buffer {
cam: &camera{0, 0},
}
buff.OpenFile(cfg.CONFIG_FULL_PATH)
return buff
}

View File

@ -1,6 +1,8 @@
package gui
import (
"os"
"github.com/felixangell/phi-editor/cfg"
"github.com/felixangell/strife"
)
@ -32,6 +34,13 @@ func (n *View) OnDispose() {}
func (n *View) addBuffer() {
c := NewBuffer(n.conf)
args := os.Args
if len(args) > 1 {
c.OpenFile(args[1])
} else {
c.OpenFile(cfg.CONFIG_FULL_PATH)
}
// work out the size of the buffer and set it
// note that we +1 the components because
// we haven't yet added the panel

Binary file not shown.