Mirror of the Vim source from https://github.com/vim/vim
Revision | 6d42026ad002e8abc9ce742a3e8b0ba7ad7cc27f (tree) |
---|---|
Time | 2022-12-20 01:00:05 |
Author | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
patch 9.0.1078: with the +vartabs feature indent folding may use wrong 'ts'
Commit: https://github.com/vim/vim/commit/07146ad1d33ba0d36b324873e5c461931e6b025e
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon Dec 19 15:51:44 2022 +0000
@@ -420,7 +420,7 @@ | ||
420 | 420 | { |
421 | 421 | # ifdef FEAT_VARTABS |
422 | 422 | return get_indent_str_vtab(ml_get_buf(buf, lnum, FALSE), |
423 | - (int)curbuf->b_p_ts, buf->b_p_vts_array, FALSE); | |
423 | + (int)buf->b_p_ts, buf->b_p_vts_array, FALSE); | |
424 | 424 | # else |
425 | 425 | return get_indent_str(ml_get_buf(buf, lnum, FALSE), (int)buf->b_p_ts, FALSE); |
426 | 426 | # endif |
@@ -157,6 +157,27 @@ | ||
157 | 157 | bw! |
158 | 158 | endfunc |
159 | 159 | |
160 | +func Test_indent_fold_tabstop() | |
161 | + call setline(1, ['0', ' 1', ' 1', "\t2", "\t2"]) | |
162 | + setlocal shiftwidth=4 | |
163 | + setlocal foldcolumn=1 | |
164 | + setlocal foldlevel=2 | |
165 | + setlocal foldmethod=indent | |
166 | + redraw | |
167 | + call assert_equal('2 2', ScreenLines(5, 10)[0]) | |
168 | + vsplit | |
169 | + windo diffthis | |
170 | + botright new | |
171 | + " This 'tabstop' value should not be used for folding in other buffers. | |
172 | + setlocal tabstop=4 | |
173 | + diffoff! | |
174 | + redraw | |
175 | + call assert_equal('2 2', ScreenLines(5, 10)[0]) | |
176 | + | |
177 | + bwipe! | |
178 | + bwipe! | |
179 | +endfunc | |
180 | + | |
160 | 181 | func Test_manual_fold_with_filter() |
161 | 182 | CheckExecutable cat |
162 | 183 | for type in ['manual', 'marker'] |
@@ -696,6 +696,8 @@ | ||
696 | 696 | static int included_patches[] = |
697 | 697 | { /* Add new patch number below this line */ |
698 | 698 | /**/ |
699 | + 1078, | |
700 | +/**/ | |
699 | 701 | 1077, |
700 | 702 | /**/ |
701 | 703 | 1076, |