mirror of
https://github.com/felixangell/phi.git
synced 2024-08-16 19:20:21 +03:00
editor can open file from fst cmd arg
This commit is contained in:
parent
23e74e1f16
commit
69bd7535b9
@ -52,8 +52,6 @@ func NewBuffer(conf *cfg.TomlConfig) *Buffer {
|
||||
cam: &camera{0, 0},
|
||||
}
|
||||
|
||||
buff.OpenFile(cfg.CONFIG_FULL_PATH)
|
||||
|
||||
return buff
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
BIN
phi-editor
BIN
phi-editor
Binary file not shown.
Loading…
Reference in New Issue
Block a user