Skip to content

Commit

Permalink
Revert jarun#1398: Go to prev dir on bookmark key repeat
Browse files Browse the repository at this point in the history
Reasons:

1. `b` is not a special key and will be interpreted as a filter
2. with this change pressing the standard `-` inside a symlinked
   bookmark takes back to the bookmarks directory. This deviates
   from the regular bookmarks behaviour.
  • Loading branch information
jarun committed Jun 14, 2022
1 parent 40f75e9 commit 51f2fde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
3 changes: 0 additions & 3 deletions nnn.1
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,6 @@ There are 2 ways (can be used together) to manage bookmarks.
On entering a bookmark, the directory where the select bookmark key was
pressed is set as the previous directory. Press '-' to return to it.
.Pp
When \fINNN_BMS\fR` is not set, it's possible to return to the previous directory
from the bookmarks directory using the select bookmark key.
.Pp
.Sh UNITS
The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y
(powers of 1024), same as the default units in \fIls\fR.
Expand Down
9 changes: 2 additions & 7 deletions src/nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -7144,13 +7144,8 @@ static bool browse(char *ipath, const char *session, int pkey)
goto nochange;
}

if (strcmp(path, newpath) == 0) {
if (bookmark || !*lastdir)
break;

dir = lastdir; /* Go to last dir on bookmark key repeat */
xstrsncpy(newpath, dir, PATH_MAX);
}
if (strcmp(path, newpath) == 0)
break;
}

/* In list mode, retain the last file name to highlight it, if possible */
Expand Down

0 comments on commit 51f2fde

Please sign in to comment.