From ea787fd572c791447b02801e02c5f46099283a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 24 Sep 2014 16:48:10 +0200 Subject: Implement :new and :vnew --- vis.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'vis.c') diff --git a/vis.c b/vis.c index e8bd9d9..4d15fdb 100644 --- a/vis.c +++ b/vis.c @@ -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); -- cgit v1.2.3