Mirror of the Vim source from https://github.com/vim/vim
Révision | d2471d710ec9b98be0a9691fbdf1c871e0e13d93 (tree) |
---|---|
l'heure | 2022-01-16 03:45:03 |
Auteur | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
patch 8.2.4100: early return when getting the 'formatlistpat' value
Commit: https://github.com/vim/vim/commit/04b871da800768287a8a432de568b11297db8686
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 15 18:31:43 2022 +0000
@@ -7058,7 +7058,6 @@ | ||
7058 | 7058 | char_u * |
7059 | 7059 | get_flp_value(buf_T *buf) |
7060 | 7060 | { |
7061 | - return buf->b_p_flp ? buf->b_p_flp : p_flp; | |
7062 | 7061 | if (buf->b_p_flp == NULL || *buf->b_p_flp == NUL) |
7063 | 7062 | return p_flp; |
7064 | 7063 | return buf->b_p_flp; |
@@ -890,7 +890,22 @@ | ||
890 | 890 | \ "~ ", |
891 | 891 | \ ] |
892 | 892 | let lines = s:screen_lines2(1, 4, 20) |
893 | - " 3) add something in front, no additional indent | |
893 | + " 3) no local formatlist pattern, | |
894 | + " so use global one -> indent | |
895 | + let g_flp = &g:flp | |
896 | + let &g:formatlistpat='^\s*\d\+\.\s\+' | |
897 | + let &l:formatlistpat='' | |
898 | + let expect = [ | |
899 | + \ " 1. word word word ", | |
900 | + \ " word word word ", | |
901 | + \ " word word ", | |
902 | + \ "~ ", | |
903 | + \ ] | |
904 | + let lines = s:screen_lines2(1, 4, 20) | |
905 | + call s:compare_lines(expect, lines) | |
906 | + let &g:flp = g_flp | |
907 | + let &l:formatlistpat='^\s*\d\+\.' | |
908 | + " 4) add something in front, no additional indent | |
894 | 909 | norm! gg0 |
895 | 910 | exe ":norm! 5iword \<esc>" |
896 | 911 | redraw! |
@@ -751,6 +751,8 @@ | ||
751 | 751 | static int included_patches[] = |
752 | 752 | { /* Add new patch number below this line */ |
753 | 753 | /**/ |
754 | + 4100, | |
755 | +/**/ | |
754 | 756 | 4099, |
755 | 757 | /**/ |
756 | 758 | 4098, |