From aae350fea5cccc830e6107e6d7d8c045308b448c Mon Sep 17 00:00:00 2001 From: CodinCat Date: Fri, 19 Aug 2016 10:53:25 +0800 Subject: [PATCH] fix cd command without any argument --- eval.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eval.go b/eval.go index d8c1d5f..5f17039 100644 --- a/eval.go +++ b/eval.go @@ -195,7 +195,11 @@ func (e *CallExpr) eval(app *App, args []string) { app.nav.top() app.ui.echoFileInfo(app.nav) case "cd": - if err := app.nav.cd(e.args[0]); err != nil { + path := "~" + if len(e.args) > 0 { + path = e.args[0] + } + if err := app.nav.cd(path); err != nil { app.ui.message = err.Error() log.Print(err) return