diff options
| author | Karl Schultheisz <kdsch@protonmail.com> | 2019-05-23 10:48:36 -0400 |
|---|---|---|
| committer | Karl Schultheisz <kdsch@protonmail.com> | 2019-05-23 10:48:36 -0400 |
| commit | cb03746137bc23f3c1b485088fefb9d4feffa368 (patch) | |
| tree | ce5ff4446fbf7ad961e3d7d0cc795b222f3188e3 /vis-cmds.c | |
| parent | f8c9f23619ffa407251426d706a996965e6d1cc9 (diff) | |
| download | vis-cb03746137bc23f3c1b485088fefb9d4feffa368.tar.gz vis-cb03746137bc23f3c1b485088fefb9d4feffa368.tar.xz | |
Add layout option
This introduces a new `set` option for setting the layout to
vertical or horizontal, which previously could not be done
without creating a new window (via `split` or `vsplit`).
Now, `set layout|lay h|v` will control this without creating
a new window.
Diffstat (limited to 'vis-cmds.c')
| -rw-r--r-- | vis-cmds.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -348,6 +348,19 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Select case OPTION_CHANGE_256COLORS: vis->change_colors = toggle ? !vis->change_colors : arg.b; break; + case OPTION_LAYOUT: { + enum UiLayout layout; + if (strcmp("h", arg.s) == 0) { + layout = UI_LAYOUT_HORIZONTAL; + } else if (strcmp("v", arg.s) == 0) { + layout = UI_LAYOUT_VERTICAL; + } else { + vis_info_show(vis, "Invalid layout `%s', expected 'h' or 'v'", arg.s); + return false; + } + windows_arrange(vis, layout); + break; + } default: if (!opt->func) return false; |
