From b7eff86a8f8930d9ed1f1c99da67ab3e35f726d9 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 31 Oct 2019 15:30:41 -0400 Subject: [PATCH] rerouted directorys to a tide window instead of a file browser. This enables acme-like directory traversal --- TODO.md | 1 + config.h | 2 +- src/tide.c | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/TODO.md b/TODO.md index 36bcd20..6c6a3e0 100644 --- a/TODO.md +++ b/TODO.md @@ -28,6 +28,7 @@ Tags: +* Dir,Ls - List current directory contents * ID - Get window id of the X window * Zerox - Create a copy of the window diff --git a/config.h b/config.h index 8126537..540d2fc 100644 --- a/config.h +++ b/config.h @@ -126,7 +126,7 @@ static Rule* BuiltinRules[] = { }, (Rule[]){ /* If it's an existing directory, open it with system default */ { ISDIR, "$data", NULL }, - { LAUNCH, OPENCMD " $data", NULL }, + { LAUNCH, "cd $data && ls -ap | tide -", NULL }, { COMPLETE, NULL, NULL } }, }; diff --git a/src/tide.c b/src/tide.c index f8b4905..d7448d9 100644 --- a/src/tide.c +++ b/src/tide.c @@ -23,8 +23,8 @@ typedef struct { } Tag; char* ARGV0; -static Tag Builtins[18]; -static KeyBinding Bindings[41]; +static Tag* Builtins; +static KeyBinding* Bindings; static WinRegion Focused = EDIT; static View Regions[NREGIONS]; static int Divider; @@ -423,6 +423,7 @@ static Tag* tag_lookup(char* cmd) for (char* tag = cmd; *tag && !isspace(*tag); tag++, len++) { + /* do nothing */ } while (tags->tag) @@ -674,7 +675,7 @@ static void tag_line(char* cmd) /* Main Routine ******************************************************************************/ -static Tag Builtins[18] = { +static Tag* Builtins = (Tag[]){ { .tag = "Cut", .action = cut }, { .tag = "Copy", .action = copy }, { .tag = "Del", .action = quit }, @@ -695,7 +696,7 @@ static Tag Builtins[18] = { { .tag = NULL, .action = NULL } }; -static KeyBinding Bindings[41] = { +static KeyBinding* Bindings = (KeyBinding[]){ /* Cursor Movements */ { .mods = ModAny, .key = KEY_HOME, .fn = cursor_home }, { .mods = ModAny, .key = KEY_END, .fn = cursor_end }, -- 2.52.0