diff options
| author | Randy Palamar <randy@rnpnr.xyz> | 2024-05-21 11:27:08 -0600 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2024-05-21 20:21:46 -0600 |
| commit | 7554ecd77efc29601b7b44deca602724917ce019 (patch) | |
| tree | 9e8e7d0ca7f0b173f98c224a25f6f626dcece8ac /vis-operators.c | |
| parent | 7e85064ac77ea43e84d88eb910b0adb6f07d5d12 (diff) | |
| download | vis-7554ecd77efc29601b7b44deca602724917ce019.tar.gz vis-7554ecd77efc29601b7b44deca602724917ce019.tar.xz | |
remove some view pointer chasing
Same as previous commit each window only has a single View. No
need for it to be stored elsewhere in memory.
Diffstat (limited to 'vis-operators.c')
| -rw-r--r-- | vis-operators.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/vis-operators.c b/vis-operators.c index 5ce64c4..59abcf6 100644 --- a/vis-operators.c +++ b/vis-operators.c @@ -102,7 +102,7 @@ static size_t op_put(Vis *vis, Text *txt, OperatorContext *c) { static size_t op_shift_right(Vis *vis, Text *txt, OperatorContext *c) { char spaces[9] = " "; - spaces[MIN(vis->win->view->tabwidth, LENGTH(spaces) - 1)] = '\0'; + spaces[MIN(vis->win->view.tabwidth, LENGTH(spaces) - 1)] = '\0'; const char *tab = vis->win->expandtab ? spaces : "\t"; size_t tablen = strlen(tab); size_t pos = text_line_begin(txt, c->range.end), prev_pos; @@ -127,7 +127,7 @@ static size_t op_shift_right(Vis *vis, Text *txt, OperatorContext *c) { static size_t op_shift_left(Vis *vis, Text *txt, OperatorContext *c) { size_t pos = text_line_begin(txt, c->range.end), prev_pos; - size_t tabwidth = vis->win->view->tabwidth, tablen; + size_t tabwidth = vis->win->view.tabwidth, tablen; size_t newpos = c->pos; /* if range ends at the begin of a line, skip line break */ @@ -161,7 +161,6 @@ static size_t op_shift_left(Vis *vis, Text *txt, OperatorContext *c) { } static size_t op_cursor(Vis *vis, Text *txt, OperatorContext *c) { - View *view = vis->win->view; Filerange r = text_range_linewise(txt, &c->range); for (size_t line = text_range_line_first(txt, &r); line != EPOS; line = text_range_line_next(txt, &r, line)) { size_t pos; @@ -169,7 +168,7 @@ static size_t op_cursor(Vis *vis, Text *txt, OperatorContext *c) { pos = text_line_finish(txt, line); else pos = text_line_start(txt, line); - view_selections_new_force(view, pos); + view_selections_new_force(&vis->win->view, pos); } return EPOS; } |
