Patch 9.0.1078
Problem: With the +vartabs feature indent folding may use wrong 'tabstop'.
Solution: Use the "buf" argument instead of "curbuf".
Files: src/indent.c, src/testdir/test_fold.vim
*** ../vim-9.0.1077/src/indent.c 2022-10-15 16:04:43.998187220 +0100
--- src/indent.c 2022-12-19 15:50:04.019923725 +0000
***************
*** 420,426 ****
{
# ifdef FEAT_VARTABS
return get_indent_str_vtab(ml_get_buf(buf, lnum, FALSE),
! (int)curbuf->b_p_ts, buf->b_p_vts_array, FALSE);
# else
return get_indent_str(ml_get_buf(buf, lnum, FALSE), (int)buf->b_p_ts,
FALSE);
# endif
--- 420,426 ----
{
# ifdef FEAT_VARTABS
return get_indent_str_vtab(ml_get_buf(buf, lnum, FALSE),
! (int)buf->b_p_ts, buf->b_p_vts_array, FALSE);
# else
return get_indent_str(ml_get_buf(buf, lnum, FALSE), (int)buf->b_p_ts,
FALSE);
# endif
*** ../vim-9.0.1077/src/testdir/test_fold.vim 2022-11-11 22:57:41.774304953
+0000
--- src/testdir/test_fold.vim 2022-12-19 15:51:09.223938033 +0000
***************
*** 157,162 ****
--- 157,183 ----
bw!
endfunc
+ func Test_indent_fold_tabstop()
+ call setline(1, ['0', ' 1', ' 1', "\t2", "\t2"])
+ setlocal shiftwidth=4
+ setlocal foldcolumn=1
+ setlocal foldlevel=2
+ setlocal foldmethod=indent
+ redraw
+ call assert_equal('2 2', ScreenLines(5, 10)[0])
+ vsplit
+ windo diffthis
+ botright new
+ " This 'tabstop' value should not be used for folding in other buffers.
+ setlocal tabstop=4
+ diffoff!
+ redraw
+ call assert_equal('2 2', ScreenLines(5, 10)[0])
+
+ bwipe!
+ bwipe!
+ endfunc
+
func Test_manual_fold_with_filter()
CheckExecutable cat
for type in ['manual', 'marker']
*** ../vim-9.0.1077/src/version.c 2022-12-19 13:30:34.319772241 +0000
--- src/version.c 2022-12-19 15:49:58.791922384 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1078,
/**/
--
Vim is like Emacs without all the typing. (John "Johann" Spetz)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20221219155223.709891C0950%40moolenaar.net.