read configuration after initialization

This commit is contained in:
Gokcehan 2019-02-09 00:55:11 +03:00
parent 92e994ebf6
commit 4a1388a5c7
2 changed files with 11 additions and 11 deletions

8
app.go
View File

@ -136,6 +136,12 @@ func (app *app) loop() {
clientChan := app.ui.readExpr()
serverChan := readExpr()
for _, path := range gConfigPaths {
if _, err := os.Stat(path); !os.IsNotExist(err) {
app.readFile(path)
}
}
if gCommand != "" {
p := newParser(strings.NewReader(gCommand))
@ -340,12 +346,12 @@ func (app *app) runShell(s string, args []string, prefix string) {
switch prefix {
case "%":
go func() {
app.cmd = cmd
app.cmdOutBuf = nil
app.ui.msg = ""
app.ui.cmdPrefix = ">"
go func() {
reader := bufio.NewReader(out)
for {
b, err := reader.ReadByte()

View File

@ -33,12 +33,6 @@ func run() {
app := newApp()
for _, path := range gConfigPaths {
if _, err := os.Stat(path); !os.IsNotExist(err) {
app.readFile(path)
}
}
if err := app.nav.readMarks(); err != nil {
app.ui.printf("reading marks file: %s", err)
}