init navigation after evaluation of config file

cc #748 #759
This commit is contained in:
Gokcehan committed 2022-03-11 15:21:27 +03:00
1 parent 8954e9f16a
commit 089e6dc705
4 files changed
+147 -23

No files matched your search

+22 -13
View File
@@ -245,19 +245,6 @@ func (app *app) loop() {
app.ui.readExpr()
if gSelect != "" {
go func() {
lstat, err := os.Lstat(gSelect)
if err != nil {
app.ui.exprChan <- &callExpr{"echoerr", []string{err.Error()}, 1}
} else if lstat.IsDir() {
app.ui.exprChan <- &callExpr{"cd", []string{gSelect}, 1}
} else {
app.ui.exprChan <- &callExpr{"select", []string{gSelect}, 1}
}
}()
}
if gConfigPath != "" {
if _, err := os.Stat(gConfigPath); !os.IsNotExist(err) {
app.readFile(gConfigPath)
@@ -284,6 +271,28 @@ func (app *app) loop() {
}
}
wd, err := os.Getwd()
if err != nil {
log.Printf("getting current directory: %s", err)
}
app.nav.getDirs(wd)
app.nav.addJumpList()
app.nav.init = true
if gSelect != "" {
go func() {
lstat, err := os.Lstat(gSelect)
if err != nil {
app.ui.exprChan <- &callExpr{"echoerr", []string{err.Error()}, 1}
} else if lstat.IsDir() {
app.ui.exprChan <- &callExpr{"cd", []string{gSelect}, 1}
} else {
app.ui.exprChan <- &callExpr{"select", []string{gSelect}, 1}
}
}()
}
for {
select {
case <-app.quitChan: