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 2021-07-09 09:34:45 -04:00 committed by GitHub
parent 55b9189713
commit 8adbd2b9ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}