# HG changeset patch # User Bram Moolenaar # Date 1642272303 -3600 # Node ID d2471d710ec9b98be0a9691fbdf1c871e0e13d93 # Parent 5d0ddfc61e6773921a31ee6b3070766565c0ac7a patch 8.2.4100: early return when getting the 'formatlistpat' value Commit: https://github.com/vim/vim/commit/04b871da800768287a8a432de568b11297db8686 Author: Bram Moolenaar Date: Sat Jan 15 18:31:43 2022 +0000 patch 8.2.4100: early return when getting the 'formatlistpat' value Problem: Early return when getting the 'formatlistpat' value. Solution: Remove the first line. (Christian Brabandt) diff --git a/src/option.c b/src/option.c --- a/src/option.c +++ b/src/option.c @@ -7058,7 +7058,6 @@ get_bkc_value(buf_T *buf) char_u * get_flp_value(buf_T *buf) { - return buf->b_p_flp ? buf->b_p_flp : p_flp; if (buf->b_p_flp == NULL || *buf->b_p_flp == NUL) return p_flp; return buf->b_p_flp; diff --git a/src/testdir/test_breakindent.vim b/src/testdir/test_breakindent.vim --- a/src/testdir/test_breakindent.vim +++ b/src/testdir/test_breakindent.vim @@ -890,7 +890,22 @@ func Test_no_extra_indent() \ "~ ", \ ] let lines = s:screen_lines2(1, 4, 20) - " 3) add something in front, no additional indent + " 3) no local formatlist pattern, + " so use global one -> indent + let g_flp = &g:flp + let &g:formatlistpat='^\s*\d\+\.\s\+' + let &l:formatlistpat='' + let expect = [ + \ " 1. word word word ", + \ " word word word ", + \ " word word ", + \ "~ ", + \ ] + let lines = s:screen_lines2(1, 4, 20) + call s:compare_lines(expect, lines) + let &g:flp = g_flp + let &l:formatlistpat='^\s*\d\+\.' + " 4) add something in front, no additional indent norm! gg0 exe ":norm! 5iword \" redraw! diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4100, +/**/ 4099, /**/ 4098,