diff options
| author | Alexey Yerin <yyp@disroot.org> | 2023-08-27 21:38:48 +0300 |
|---|---|---|
| committer | Randy Palamar <palamar@ualberta.ca> | 2023-08-27 12:55:29 -0600 |
| commit | 450dc2df6a3b6443e372dc86cbefc8fede71b54d (patch) | |
| tree | 28762e11e14318aa662b53b66074dd89f7438165 /vis.c | |
| parent | ae450f738c0ed07b3b892449463c817a2125c2e7 (diff) | |
| download | vis-450dc2df6a3b6443e372dc86cbefc8fede71b54d.tar.gz vis-450dc2df6a3b6443e372dc86cbefc8fede71b54d.tar.xz | |
Make tabwidth option window-local
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -498,7 +498,6 @@ Win *window_new_file(Vis *vis, File *file, enum UiOption options) { mark_init(&win->saved_selections); file->refcount++; view_options_set(win->view, view_options_get(win->view)); - view_tabwidth_set(win->view, vis->tabwidth); if (vis->windows) vis->windows->prev = win; @@ -695,7 +694,6 @@ Vis *vis_new(Ui *ui, VisEvent *event) { return NULL; vis->exit_status = -1; vis->ui = ui; - vis->tabwidth = 8; vis->expandtab = false; vis->change_colors = true; for (size_t i = 0; i < LENGTH(vis->registers); i++) @@ -1651,7 +1649,7 @@ void vis_insert_tab(Vis *vis) { return; } char spaces[9]; - int tabwidth = MIN(vis->tabwidth, LENGTH(spaces) - 1); + int tabwidth = MIN(view_tabwidth_get(vis->win->view), LENGTH(spaces) - 1); for (Selection *s = view_selections(win->view); s; s = view_selections_next(s)) { size_t pos = view_cursors_pos(s); int width = text_line_width_get(win->file->text, pos); |
