read configuration after initialization
This commit is contained in:
parent
92e994ebf6
commit
4a1388a5c7
16
app.go
16
app.go
@ -136,6 +136,12 @@ func (app *app) loop() {
|
|||||||
clientChan := app.ui.readExpr()
|
clientChan := app.ui.readExpr()
|
||||||
serverChan := readExpr()
|
serverChan := readExpr()
|
||||||
|
|
||||||
|
for _, path := range gConfigPaths {
|
||||||
|
if _, err := os.Stat(path); !os.IsNotExist(err) {
|
||||||
|
app.readFile(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if gCommand != "" {
|
if gCommand != "" {
|
||||||
p := newParser(strings.NewReader(gCommand))
|
p := newParser(strings.NewReader(gCommand))
|
||||||
|
|
||||||
@ -340,12 +346,12 @@ func (app *app) runShell(s string, args []string, prefix string) {
|
|||||||
|
|
||||||
switch prefix {
|
switch prefix {
|
||||||
case "%":
|
case "%":
|
||||||
go func() {
|
app.cmd = cmd
|
||||||
app.cmd = cmd
|
app.cmdOutBuf = nil
|
||||||
app.cmdOutBuf = nil
|
app.ui.msg = ""
|
||||||
app.ui.msg = ""
|
app.ui.cmdPrefix = ">"
|
||||||
app.ui.cmdPrefix = ">"
|
|
||||||
|
|
||||||
|
go func() {
|
||||||
reader := bufio.NewReader(out)
|
reader := bufio.NewReader(out)
|
||||||
for {
|
for {
|
||||||
b, err := reader.ReadByte()
|
b, err := reader.ReadByte()
|
||||||
|
@ -33,12 +33,6 @@ func run() {
|
|||||||
|
|
||||||
app := newApp()
|
app := newApp()
|
||||||
|
|
||||||
for _, path := range gConfigPaths {
|
|
||||||
if _, err := os.Stat(path); !os.IsNotExist(err) {
|
|
||||||
app.readFile(path)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := app.nav.readMarks(); err != nil {
|
if err := app.nav.readMarks(); err != nil {
|
||||||
app.ui.printf("reading marks file: %s", err)
|
app.ui.printf("reading marks file: %s", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user