aboutsummaryrefslogtreecommitdiff
path: root/vis-cmds.c
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2024-05-21 10:23:25 -0600
committerRandy Palamar <randy@rnpnr.xyz>2024-05-21 20:21:46 -0600
commit7e85064ac77ea43e84d88eb910b0adb6f07d5d12 (patch)
tree60087cfc22d2e8c67b2d83a7202a8bbb2a5c1c1e /vis-cmds.c
parent486e8631ce9269d34c00c07038e04013640f8825 (diff)
downloadvis-7e85064ac77ea43e84d88eb910b0adb6f07d5d12.tar.gz
vis-7e85064ac77ea43e84d88eb910b0adb6f07d5d12.tar.xz
remove some ui pointer chasing
There only exists a single Ui so there is no need to force a pointer redirection for accessing it. The Ui member was moved down in vis-core.h to punt around an issue with the way lua checks for existing objects. It may show up again as I flatten more structs.
Diffstat (limited to 'vis-cmds.c')
-rw-r--r--vis-cmds.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/vis-cmds.c b/vis-cmds.c
index 1515bc8..ae9ba49 100644
--- a/vis-cmds.c
+++ b/vis-cmds.c
@@ -246,8 +246,7 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Select
break;
case OPTION_ESCDELAY:
{
- TermKey *termkey = vis->ui->termkey;
- termkey_set_waittime(termkey, arg.i);
+ termkey_set_waittime(vis->ui.termkey, arg.i);
break;
}
case OPTION_EXPANDTAB:
@@ -354,7 +353,7 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Select
vis_info_show(vis, "Invalid layout `%s', expected 'h' or 'v'", arg.s);
return false;
}
- ui_arrange(vis->ui, layout);
+ ui_arrange(&vis->ui, layout);
break;
}
case OPTION_IGNORECASE:
@@ -542,7 +541,7 @@ static bool cmd_split(Vis *vis, Win *win, Command *cmd, const char *argv[], Sele
if (!win)
return false;
enum UiOption options = UI_OPTIONS_GET(win->view->ui);
- ui_arrange(vis->ui, UI_LAYOUT_HORIZONTAL);
+ ui_arrange(&vis->ui, UI_LAYOUT_HORIZONTAL);
if (!argv[1])
return vis_window_split(win);
bool ret = openfiles(vis, &argv[1]);
@@ -555,7 +554,7 @@ static bool cmd_vsplit(Vis *vis, Win *win, Command *cmd, const char *argv[], Sel
if (!win)
return false;
enum UiOption options = UI_OPTIONS_GET(win->view->ui);
- ui_arrange(vis->ui, UI_LAYOUT_VERTICAL);
+ ui_arrange(&vis->ui, UI_LAYOUT_VERTICAL);
if (!argv[1])
return vis_window_split(win);
bool ret = openfiles(vis, &argv[1]);
@@ -565,12 +564,12 @@ static bool cmd_vsplit(Vis *vis, Win *win, Command *cmd, const char *argv[], Sel
}
static bool cmd_new(Vis *vis, Win *win, Command *cmd, const char *argv[], Selection *sel, Filerange *range) {
- ui_arrange(vis->ui, UI_LAYOUT_HORIZONTAL);
+ ui_arrange(&vis->ui, UI_LAYOUT_HORIZONTAL);
return vis_window_new(vis, NULL);
}
static bool cmd_vnew(Vis *vis, Win *win, Command *cmd, const char *argv[], Selection *sel, Filerange *range) {
- ui_arrange(vis->ui, UI_LAYOUT_VERTICAL);
+ ui_arrange(&vis->ui, UI_LAYOUT_VERTICAL);
return vis_window_new(vis, NULL);
}
@@ -775,7 +774,7 @@ static void print_symbolic_keys(Vis *vis, Text *txt) {
TERMKEY_SYM_KPEQUALS,
};
- TermKey *termkey = vis->ui->termkey;
+ TermKey *termkey = vis->ui.termkey;
text_appendf(txt, " ␣ (a literal \" \" space symbol must be used to refer to <Space>)\n");
for (size_t i = 0; i < LENGTH(keys); i++) {
text_appendf(txt, " <%s>\n", termkey_get_keyname(termkey, keys[i]));