aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.def.h2
-rw-r--r--vis.c8
2 files changed, 3 insertions, 7 deletions
diff --git a/config.def.h b/config.def.h
index e9c055a..655671f 100644
--- a/config.def.h
+++ b/config.def.h
@@ -370,7 +370,7 @@ static KeyBinding vis_marks_set[] = {
};
static KeyBinding vis_mode_normal[] = {
- { { CONTROL('w'), NONE('n') }, winnew, { .s = NULL } },
+ { { CONTROL('w'), NONE('n') }, cmd, { .s = "open" } },
{ { CONTROL('w'), NONE('c') }, cmd, { .s = "q" } },
{ { CONTROL('w'), NONE('s') }, cmd, { .s = "split" } },
{ { CONTROL('w'), NONE('v') }, cmd, { .s = "vsplit" } },
diff --git a/vis.c b/vis.c
index 30301d4..c0da6ac 100644
--- a/vis.c
+++ b/vis.c
@@ -408,8 +408,6 @@ static void put(const Arg *arg);
static void openline(const Arg *arg);
/* join lines from current cursor position to movement indicated by arg */
static void join(const Arg *arg);
-/* create a new window with the filename arg->s */
-static void winnew(const Arg *arg);
/* execute arg->s as if it was typed on command prompt */
static void cmd(const Arg *arg);
/* perform last action i.e. action_prev again */
@@ -1061,10 +1059,6 @@ static void quit(const Arg *arg) {
running = false;
}
-static void winnew(const Arg *arg) {
- vis_window_new(arg->s);
-}
-
static void cmd(const Arg *arg) {
/* casting to char* is only save if arg->s contains no arguments */
exec_command(':', (char*)arg->s);
@@ -1447,6 +1441,8 @@ static bool cmd_set(Filerange *range, const char *argv[]) {
}
static bool cmd_open(Filerange *range, const char *argv[]) {
+ if (!argv[1])
+ return vis_window_new(NULL);
for (const char **file = &argv[1]; *file; file++) {
if (!vis_window_new(*file)) {
errno = 0;