From 8adbd2b9ef5de08f105b283b747301d98bac8b46 Mon Sep 17 00:00:00 2001 From: SeerLite Date: Fri, 9 Jul 2021 09:34:45 -0400 Subject: [PATCH] Don't use the absolute path when saving bookmarks (#659) The absolute path of symlinks were getting saved, so bookmarking a symlink directory would cause the absolute path to be saved and loaded instead. What's saved now is the current path string as understood by lf instead, so path to symlinks can be saved too and they won't get dereferenced when loading. --- eval.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/eval.go b/eval.go index f3af3a0..fb07b49 100644 --- a/eval.go +++ b/eval.go @@ -605,12 +605,7 @@ func insert(app *app, arg string) { case app.ui.cmdPrefix == "mark-save: ": normal(app) - wd, err := os.Getwd() - if err != nil { - log.Printf("getting current directory: %s", err) - return - } - app.nav.marks[arg] = wd + app.nav.marks[arg] = app.nav.currDir().path if err := app.nav.writeMarks(); err != nil { app.ui.echoerrf("mark-save: %s", err) }