diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-24 16:48:10 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-24 16:48:10 +0200 |
| commit | ea787fd572c791447b02801e02c5f46099283a00 (patch) | |
| tree | 600ac70007f2496f4403f70a7b58749841216fbe /vis.c | |
| parent | 41debbfd7649a347f5c49489ed4de536f9d62c78 (diff) | |
| download | vis-ea787fd572c791447b02801e02c5f46099283a00.tar.gz vis-ea787fd572c791447b02801e02c5f46099283a00.tar.xz | |
Implement :new and :vnew
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -454,6 +454,9 @@ static bool cmd_split(const char *argv[]); /* if no argument are given, split the current window vertically, * otherwise open the file */ static bool cmd_vsplit(const char *argv[]); +/* create a new empty window and arrange all windows either horizontally or vertically */ +static bool cmd_new(const char *argv[]); +static bool cmd_vnew(const char *argv[]); /* save the file displayed in the current window and close it */ static bool cmd_wq(const char *argv[]); /* save the file displayed in the current window to the name given. @@ -1254,6 +1257,16 @@ static bool cmd_vsplit(const char *argv[]) { return openfiles(&argv[1]); } +static bool cmd_new(const char *argv[]) { + editor_windows_arrange_horizontal(vis); + return editor_window_new(vis, NULL); +} + +static bool cmd_vnew(const char *argv[]) { + editor_windows_arrange_vertical(vis); + return editor_window_new(vis, NULL); +} + static bool cmd_wq(const char *argv[]) { if (cmd_write(argv)) return cmd_quit(argv); |
