From: Arun Prakash Jana Date: Mon, 30 May 2022 16:50:45 +0000 (+0530) Subject: Revert "Enter type-to-nav for bookmarks dir" X-Git-Tag: v4.6~59 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=10e2d37d0f590e772ebfe07603baca573d051e59;p=nnn.git Revert "Enter type-to-nav for bookmarks dir" This reverts commit 8cdeddeb4a53b371d863d65c21e1f0ffe342f536. --- diff --git a/src/nnn.c b/src/nnn.c index 4ae55ccd..1465f4ab 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -367,12 +367,12 @@ typedef struct { uint_t rangesel : 1; /* Range selection on */ uint_t runctx : 3; /* The context in which plugin is to be run */ uint_t runplugin : 1; /* Choose plugin mode */ - uint_t selbm : 2; /* Select bookmark dir and store type-to-nav */ + uint_t selbm : 1; /* Select a bookmark from bookmarks directory */ uint_t selmode : 1; /* Set when selecting files */ uint_t stayonsel : 1; /* Disable auto-jump on select */ uint_t trash : 2; /* Trash method 0: rm -rf, 1: trash-cli, 2: gio trash */ uint_t uidgid : 1; /* Show owner and group info */ - uint_t reserved : 5; /* Adjust when adding/removing a field */ + uint_t reserved : 6; /* Adjust when adding/removing a field */ } runstate; /* Contexts or workspaces */ @@ -4988,17 +4988,14 @@ static size_t handle_bookmark(const char *bmark, char *newpath) bmark ? xstrsncpy(newpath, bmark, PATH_MAX) : (r = MSG_NOT_SET); else if (fd == '\r') { /* Visit bookmarks directory */ mkpath(cfgpath, toks[TOK_BM], newpath); - g_state.selbm = cfg.filtermode + 1; - cfg.filtermode = 1; + g_state.selbm = 1; } else if (!get_kv_val(bookmark, newpath, fd, maxbm, NNN_BMS)) r = MSG_INVALID_KEY; if (!r && chdir(newpath) == -1) { r = MSG_ACCESS; - if (g_state.selbm) { - cfg.filtermode = g_state.selbm - 1; + if (g_state.selbm) g_state.selbm = 0; - } } return r; @@ -6907,7 +6904,6 @@ nochange: /* Cannot descend in empty directories */ if (!ndents) { cd = FALSE; - cfg.filtermode = g_state.selbm - 1; g_state.selbm = g_state.runplugin = 0; goto begin; } @@ -6917,7 +6913,6 @@ nochange: S_ISLNK(pent->mode) ? (realpath(pent->name, newpath) && xstrsncpy(path, lastdir, PATH_MAX)) : mkpath(path, pent->name, newpath); - cfg.filtermode = g_state.selbm - 1; g_state.selbm = 0; } else mkpath(path, pent->name, newpath);