From 70fa1e8594be04c203179e8249a27ae648a81e71 Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Thu, 23 May 2024 22:21:40 -0600 Subject: 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. --- vis-cmds.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'vis-cmds.c') 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; } -- cgit v1.2.3