]> Sergey Matveev's repositories - nnn.git/blobdiff - src/nnn.c
F3 view
[nnn.git] / src / nnn.c
index dbc64197fd50e5bfa15e0313492f6dc1a865ca73..566d12c6a84512456cdf1e4287c31b934c008173 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -7454,13 +7454,14 @@ nochange:
                case SEL_HELP: // fallthrough
                case SEL_AUTONEXT: // fallthrough
                case SEL_EDIT: // fallthrough
+               case SEL_VIEW: // fallthrough
                case SEL_LOCK:
                {
                        bool refresh = FALSE;
 
                        if (ndents)
                                mkpath(path, pdents[cur].name, newpath);
-                       else if (sel == SEL_EDIT) /* Avoid trying to edit a non-existing file */
+                       else if ((sel == SEL_EDIT) || (sel == SEL_VIEW)) /* Avoid trying to edit a non-existing file */
                                goto nochange;
 
                        switch (sel) {
@@ -7498,6 +7499,10 @@ nochange:
                                if (!(g_state.picker || g_state.fifomode))
                                        spawn(editor, newpath, NULL, NULL, F_CLI);
                                continue;
+                       case SEL_VIEW:
+                               if (!(g_state.picker || g_state.fifomode))
+                                       spawn(pager, newpath, NULL, NULL, F_CLI);
+                               continue;
                        default: /* SEL_LOCK */
                                lock_terminal();
                                break;