]> Sergey Matveev's repositories - nnn.git/commitdiff
Revert "Enter type-to-nav for bookmarks dir"
authorArun Prakash Jana <engineerarun@gmail.com>
Mon, 30 May 2022 16:50:45 +0000 (22:20 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Mon, 30 May 2022 16:50:45 +0000 (22:20 +0530)
This reverts commit 8cdeddeb4a53b371d863d65c21e1f0ffe342f536.

src/nnn.c

index 4ae55ccdd2be81cc5a3566dc165ea821eb1a24fe..1465f4ab76291d8e976697cb55a39b02fb9cc88c 100644 (file)
--- 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);