]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4100: early return when getting the 'formatlistpat' value v8.2.4100
authorBram Moolenaar <Bram@vim.org>
Sat, 15 Jan 2022 18:31:43 +0000 (18:31 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 15 Jan 2022 18:31:43 +0000 (18:31 +0000)
Problem:    Early return when getting the 'formatlistpat' value.
Solution:   Remove the first line. (Christian Brabandt)

src/option.c
src/testdir/test_breakindent.vim
src/version.c

index 0a75c2417c45176a292b65132fb6cbf6e2f4ec51..ff539683e14ae3c78077d1e477921c4b10f0b0b9 100644 (file)
@@ -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;
index 2ac127dd54841ffbc421110fcee0e6ebee490ab6..6258a7ac5f369efd64066ef618ccd0bcdaeda6cd 100644 (file)
@@ -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 \<esc>"
   redraw!
index 5bf6df495e66e1d5dda45a226d7dc7a06381668b..d34f1a1536cf82c8ff529e45db76968fa07d4bfa 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4100,
 /**/
     4099,
 /**/