Support make option O_CTX8 for 8 contexts

Note that this is not compatible with 4 contexts.
This commit is contained in:
Arun Prakash Jana 2020-05-30 06:59:45 +05:30
parent 4d291d0ac2
commit e3d90a98ce
No known key found for this signature in database
GPG key ID: A75979F35C080412
4 changed files with 32 additions and 0 deletions

View file

@ -61,6 +61,10 @@ ifeq ($(O_NOFIFO),1)
CPPFLAGS += -DNOFIFO CPPFLAGS += -DNOFIFO
endif endif
ifeq ($(O_CTX8),1)
CPPFLAGS += -DCTX8
endif
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1) ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw) CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw) LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)

View file

@ -52,6 +52,10 @@ ifeq ($(O_NOMOUSE),1)
CPPFLAGS += -DNOMOUSE CPPFLAGS += -DNOMOUSE
endif endif
ifeq ($(O_CTX8),1)
CPPFLAGS += -DCTX8
endif
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1) ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw) CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw) LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)

View file

@ -157,7 +157,13 @@
#define EXEC_ARGS_MAX 8 #define EXEC_ARGS_MAX 8
#define LIST_FILES_MAX (1 << 16) #define LIST_FILES_MAX (1 << 16)
#define SCROLLOFF 3 #define SCROLLOFF 3
#ifndef CTX8
#define CTX_MAX 4 #define CTX_MAX 4
#else
#define CTX_MAX 8
#endif
#define MIN_DISPLAY_COLS ((CTX_MAX * 2) + 2) /* Two chars for [ and ] */ #define MIN_DISPLAY_COLS ((CTX_MAX * 2) + 2) /* Two chars for [ and ] */
#define LONG_SIZE sizeof(ulong) #define LONG_SIZE sizeof(ulong)
#define ARCHIVE_CMD_LEN 16 #define ARCHIVE_CMD_LEN 16
@ -5738,6 +5744,12 @@ nochange:
case SEL_CTX2: // fallthrough case SEL_CTX2: // fallthrough
case SEL_CTX3: // fallthrough case SEL_CTX3: // fallthrough
case SEL_CTX4: case SEL_CTX4:
#ifdef CTX8
case SEL_CTX5:
case SEL_CTX6:
case SEL_CTX7:
case SEL_CTX8:
#endif
r = handle_context_switch(sel); r = handle_context_switch(sel);
if (r < 0) if (r < 0)
continue; continue;

View file

@ -60,6 +60,12 @@ enum action {
SEL_CTX2, SEL_CTX2,
SEL_CTX3, SEL_CTX3,
SEL_CTX4, SEL_CTX4,
#ifdef CTX8
SEL_CTX5,
SEL_CTX6,
SEL_CTX7,
SEL_CTX8,
#endif
SEL_PIN, SEL_PIN,
SEL_FLTR, SEL_FLTR,
SEL_MFLTR, SEL_MFLTR,
@ -165,6 +171,12 @@ static struct key bindings[] = {
{ '2', SEL_CTX2 }, { '2', SEL_CTX2 },
{ '3', SEL_CTX3 }, { '3', SEL_CTX3 },
{ '4', SEL_CTX4 }, { '4', SEL_CTX4 },
#ifdef CTX8
{ '5', SEL_CTX5 },
{ '6', SEL_CTX6 },
{ '7', SEL_CTX7 },
{ '8', SEL_CTX8 },
#endif
/* Mark a path to visit later */ /* Mark a path to visit later */
{ ',', SEL_PIN }, { ',', SEL_PIN },
/* Filter */ /* Filter */