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.
This commit is contained in:
SeerLite authored and GitHub committed 2021-07-09 16:34:45 +03:00
1 parent 55b9189713
commit 8adbd2b9ef
1 file changed
+1 -6
+1 -6
View File
@@ -605,12 +605,7 @@ func insert(app *app, arg string) {
case app.ui.cmdPrefix == "mark-save: ": case app.ui.cmdPrefix == "mark-save: ":
normal(app) normal(app)
wd, err := os.Getwd() app.nav.marks[arg] = app.nav.currDir().path
if err != nil {
log.Printf("getting current directory: %s", err)
return
}
app.nav.marks[arg] = wd
if err := app.nav.writeMarks(); err != nil { if err := app.nav.writeMarks(); err != nil {
app.ui.echoerrf("mark-save: %s", err) app.ui.echoerrf("mark-save: %s", err)
} }