Explorar el Código

Auto-proceed on open (key + to toggle)

master
Arun Prakash Jana hace 5 años
padre
commit
6f48a711d4
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: A75979F35C080412
Se han modificado 2 ficheros con 17 adiciones y 4 borrados
  1. +12
    -3
      src/nnn.c
  2. +5
    -1
      src/nnn.h

+ 12
- 3
src/nnn.c Ver fichero

@@ -385,6 +385,7 @@ static char g_pipepath[TMP_LEN_MAX] __attribute__ ((aligned));
#define STATE_INTERRUPTED 0x2 #define STATE_INTERRUPTED 0x2
#define STATE_RANGESEL 0x4 #define STATE_RANGESEL 0x4
#define STATE_MOVE_OP 0x8 #define STATE_MOVE_OP 0x8
#define STATE_AUTONEXT 0x10


static uchar g_states; static uchar g_states;


@@ -3759,9 +3760,9 @@ static void show_help(const char *path)
"a1-4 Context 1-4%-8c(B)Tab Cycle context\n" "a1-4 Context 1-4%-8c(B)Tab Cycle context\n"
"c/ Filter%-17c^N Nav-as-you-type toggle\n" "c/ Filter%-17c^N Nav-as-you-type toggle\n"
"aEsc Exit prompt%-12c^L Redraw/clear prompt\n" "aEsc Exit prompt%-12c^L Redraw/clear prompt\n"
"c? Help, conf%-13c^G QuitCD\n" "c? Help, conf%-14c+ Toggle proceed on open\n"
"cq Quit context%-12cQ Quit with err\n" "cq Quit context%-11c^G QuitCD\n"
"b^Q Quit\n" "b^Q Quit%-20cQ Quit with err\n"
"1FILES\n" "1FILES\n"
"9o ^O Open with...%-12cn Create new/link\n" "9o ^O Open with...%-12cn Create new/link\n"
"9f ^F File details%-12cd Detail view toggle\n" "9f ^F File details%-12cd Detail view toggle\n"
@@ -5017,6 +5018,11 @@ nochange:


/* Invoke desktop opener as last resort */ /* Invoke desktop opener as last resort */
spawn(opener, newpath, NULL, NULL, opener_flags); spawn(opener, newpath, NULL, NULL, opener_flags);

/* Move cursor to the next entry if not the last entry */
if ((g_states & STATE_AUTONEXT) && cur != ndents - 1)
move_cursor((cur + 1) % ndents, 0);

continue; continue;
} }
default: default:
@@ -5770,6 +5776,9 @@ nochange:


statusbar(path); statusbar(path);
goto nochange; goto nochange;
case SEL_AUTONEXT:
g_states ^= STATE_AUTONEXT;
goto nochange;
case SEL_QUITCTX: // fallthrough case SEL_QUITCTX: // fallthrough
case SEL_QUITCD: // fallthrough case SEL_QUITCD: // fallthrough
case SEL_QUIT: case SEL_QUIT:


+ 5
- 1
src/nnn.h Ver fichero

@@ -90,6 +90,7 @@ enum action {
SEL_RUNCMD, SEL_RUNCMD,
SEL_LOCK, SEL_LOCK,
SEL_SESSIONS, SEL_SESSIONS,
SEL_AUTONEXT,
SEL_QUITCTX, SEL_QUITCTX,
SEL_QUITCD, SEL_QUITCD,
SEL_QUIT, SEL_QUIT,
@@ -229,6 +230,10 @@ static struct key bindings[] = {
{ ']', SEL_RUNCMD }, { ']', SEL_RUNCMD },
/* Lock screen */ /* Lock screen */
{ '0', SEL_LOCK }, { '0', SEL_LOCK },
/* Manage sessions */
{ 's', SEL_SESSIONS },
/* Quit a context */
{ '+', SEL_AUTONEXT },
/* Quit a context */ /* Quit a context */
{ 'q', SEL_QUITCTX }, { 'q', SEL_QUITCTX },
/* Change dir on quit */ /* Change dir on quit */
@@ -238,5 +243,4 @@ static struct key bindings[] = {
/* Quit with an error code */ /* Quit with an error code */
{ 'Q', SEL_QUITFAIL }, { 'Q', SEL_QUITFAIL },
{ KEY_MOUSE, SEL_CLICK }, { KEY_MOUSE, SEL_CLICK },
{ 's', SEL_SESSIONS },
}; };

||||||
x
 
000:0
Cargando…
Cancelar
Guardar