aboutsummaryrefslogtreecommitdiff
path: root/vis-cmds.c
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2024-05-23 22:21:40 -0600
committerRandy Palamar <randy@rnpnr.xyz>2024-05-24 15:23:41 -0600
commit70fa1e8594be04c203179e8249a27ae648a81e71 (patch)
treee4160703953dfef02ba74df0f78840088e46c91c /vis-cmds.c
parent66c7dfeec6367eac5f7b0f9eff451a0577d8eae7 (diff)
downloadvis-70fa1e8594be04c203179e8249a27ae648a81e71.tar.gz
vis-70fa1e8594be04c203179e8249a27ae648a81e71.tar.xz
combine Win and UiWin
These are not seperate things and keeping them this way makes gives this convoluted mess where both Wins and UiWins must have linked lists to the other Wins and UiWins in the program despite the fact that neither of them can exist in isolation. This, like my previous cleanup commits, is part of a larger goal of properly isolating the various subsystems in vis. Doing so is required if we ever want to be able to have a vis-server and a vis-client.
Diffstat (limited to 'vis-cmds.c')
-rw-r--r--vis-cmds.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/vis-cmds.c b/vis-cmds.c
index 382a7d7..4cfb3bd 100644
--- a/vis-cmds.c
+++ b/vis-cmds.c
@@ -271,43 +271,43 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Select
[OPTION_SHOW_EOF] = UI_OPTION_SYMBOL_EOF,
[OPTION_STATUSBAR] = UI_OPTION_STATUSBAR,
};
- int flags = UI_OPTIONS_GET(win->view.ui);
+ int flags = win->options;
if (arg.b || (toggle && !(flags & values[opt_index])))
flags |= values[opt_index];
else
flags &= ~values[opt_index];
- view_options_set(&win->view, flags);
+ win_options_set(win, flags);
break;
}
case OPTION_NUMBER: {
- enum UiOption opt = UI_OPTIONS_GET(win->view.ui);
+ enum UiOption opt = win->options;
if (arg.b || (toggle && !(opt & UI_OPTION_LINE_NUMBERS_ABSOLUTE))) {
opt &= ~UI_OPTION_LINE_NUMBERS_RELATIVE;
opt |= UI_OPTION_LINE_NUMBERS_ABSOLUTE;
} else {
opt &= ~UI_OPTION_LINE_NUMBERS_ABSOLUTE;
}
- view_options_set(&win->view, opt);
+ win_options_set(win, opt);
break;
}
case OPTION_NUMBER_RELATIVE: {
- enum UiOption opt = UI_OPTIONS_GET(win->view.ui);
+ enum UiOption opt = win->options;
if (arg.b || (toggle && !(opt & UI_OPTION_LINE_NUMBERS_RELATIVE))) {
opt &= ~UI_OPTION_LINE_NUMBERS_ABSOLUTE;
opt |= UI_OPTION_LINE_NUMBERS_RELATIVE;
} else {
opt &= ~UI_OPTION_LINE_NUMBERS_RELATIVE;
}
- view_options_set(&win->view, opt);
+ win_options_set(win, opt);
break;
}
case OPTION_CURSOR_LINE: {
- enum UiOption opt = UI_OPTIONS_GET(win->view.ui);
+ enum UiOption opt = win->options;
if (arg.b || (toggle && !(opt & UI_OPTION_CURSOR_LINE)))
opt |= UI_OPTION_CURSOR_LINE;
else
opt &= ~UI_OPTION_CURSOR_LINE;
- view_options_set(&win->view, opt);
+ win_options_set(win, opt);
break;
}
case OPTION_COLOR_COLUMN:
@@ -540,26 +540,26 @@ static bool cmd_qall(Vis *vis, Win *win, Command *cmd, const char *argv[], Selec
static bool cmd_split(Vis *vis, Win *win, Command *cmd, const char *argv[], Selection *sel, Filerange *range) {
if (!win)
return false;
- enum UiOption options = UI_OPTIONS_GET(win->view.ui);
+ enum UiOption options = win->options;
ui_arrange(&vis->ui, UI_LAYOUT_HORIZONTAL);
if (!argv[1])
return vis_window_split(win);
bool ret = openfiles(vis, &argv[1]);
if (ret)
- view_options_set(&vis->win->view, options);
+ win_options_set(vis->win, options);
return ret;
}
static bool cmd_vsplit(Vis *vis, Win *win, Command *cmd, const char *argv[], Selection *sel, Filerange *range) {
if (!win)
return false;
- enum UiOption options = UI_OPTIONS_GET(win->view.ui);
+ enum UiOption options = win->options;
ui_arrange(&vis->ui, UI_LAYOUT_VERTICAL);
if (!argv[1])
return vis_window_split(win);
bool ret = openfiles(vis, &argv[1]);
if (ret)
- view_options_set(&vis->win->view, options);
+ win_options_set(vis->win, options);
return ret;
}