diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-05-31 14:56:25 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-05-31 14:56:25 -0700 |
| commit | ca9ff7e94177388a73842713ff37a84fd3eaad53 (patch) | |
| tree | b2ed9455d95d0d46c6537be9bfa3bd967a9b790b | |
| parent | 06fa2d5b3c4aae1e833cbedbecabbf924789c7c7 (diff) | |
Moved colwidths to config
| -rw-r--r-- | bb.c | 11 | ||||
| -rw-r--r-- | config.def.h | 14 |
2 files changed, 15 insertions, 10 deletions
@@ -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" |
