aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bb.c11
-rw-r--r--config.def.h14
2 files changed, 15 insertions, 10 deletions
diff --git a/bb.c b/bb.c
index 33be821..194ff90 100644
--- a/bb.c
+++ b/bb.c
@@ -151,6 +151,7 @@ static void print_bindings(void);
// Config options
extern binding_t bindings[];
extern const char *startupcmds[];
+extern const int colwidths[128];
// Constants
static const char *T_ENTER_BBMODE = T_OFF(T_SHOW_CURSOR) T_ON(T_MOUSE_XY ";" T_MOUSE_CELL ";" T_MOUSE_SGR ";" T_WRAP);
@@ -164,16 +165,6 @@ static int termwidth, termheight;
static int mouse_x, mouse_y;
static char *cmdfilename = NULL;
static struct timespec lastclick = {0, 0};
-static const int colwidths[128] = {
- [COL_SELECTED] = 2,
- [COL_SIZE] = 9,
- [COL_MTIME] = 21,
- [COL_ATIME] = 21,
- [COL_CTIME] = 21,
- [COL_PERM] = 5,
- [COL_NAME] = 40,
- [COL_RANDOM] = 2,
-};
/*
diff --git a/config.def.h b/config.def.h
index 816e660..fcf0838 100644
--- a/config.def.h
+++ b/config.def.h
@@ -91,6 +91,8 @@ typedef struct {
// These commands will run at startup (before command-line arguments)
extern const char *startupcmds[];
+extern const int colwidths[128];
+
const char *startupcmds[] = {
//////////////////////////////////////////////
// User-defined startup commands can go here
@@ -103,6 +105,18 @@ const char *startupcmds[] = {
NULL, // NULL-terminated array
};
+// Column widths:
+const int colwidths[128] = {
+ ['*'] = 2,
+ ['s'] = 9,
+ ['m'] = 21,
+ ['a'] = 21,
+ ['c'] = 21,
+ ['p'] = 5,
+ ['n'] = 40,
+ ['r'] = 2,
+};
+
#ifdef __APPLE__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"