diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-01-06 18:44:29 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-01-06 22:15:26 +0100 |
| commit | 876b8f94649c9ec405375cf687b55a65e2e666ec (patch) | |
| tree | 672e184c16bc6a5749869d75847b9db1fdeb570b /vis.c | |
| parent | 855a1acf28a8e68659fb084018a564c2d59e2c64 (diff) | |
| download | vis-876b8f94649c9ec405375cf687b55a65e2e666ec.tar.gz vis-876b8f94649c9ec405375cf687b55a65e2e666ec.tar.xz | |
Change :open to create a new window if no argument is given
Use it for the creation of a new window without changing the
layout as split and vsplit do. Map it to CTRL+w n.
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -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; |
