aboutsummaryrefslogtreecommitdiff
path: root/vis-operators.c
diff options
context:
space:
mode:
authorAlexey Yerin <yyp@disroot.org>2023-08-27 21:38:48 +0300
committerRandy Palamar <palamar@ualberta.ca>2023-08-27 12:55:29 -0600
commit450dc2df6a3b6443e372dc86cbefc8fede71b54d (patch)
tree28762e11e14318aa662b53b66074dd89f7438165 /vis-operators.c
parentae450f738c0ed07b3b892449463c817a2125c2e7 (diff)
downloadvis-450dc2df6a3b6443e372dc86cbefc8fede71b54d.tar.gz
vis-450dc2df6a3b6443e372dc86cbefc8fede71b54d.tar.xz
Make tabwidth option window-local
Diffstat (limited to 'vis-operators.c')
-rw-r--r--vis-operators.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vis-operators.c b/vis-operators.c
index 6523a85..a447543 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->tabwidth, LENGTH(spaces) - 1)] = '\0';
+ spaces[MIN(view_tabwidth_get(vis->win->view), LENGTH(spaces) - 1)] = '\0';
const char *tab = vis->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->tabwidth, tablen;
+ size_t tabwidth = view_tabwidth_get(vis->win->view), tablen;
size_t newpos = c->pos;
/* if range ends at the begin of a line, skip line break */