mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
vim-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)
04b871da80
This commit is contained in:
@@ -5225,7 +5225,6 @@ unsigned int get_bkc_value(buf_T *buf)
|
|||||||
/// @param buf The buffer.
|
/// @param buf The buffer.
|
||||||
char *get_flp_value(buf_T *buf)
|
char *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) {
|
if (buf->b_p_flp == NULL || *buf->b_p_flp == NUL) {
|
||||||
return p_flp;
|
return p_flp;
|
||||||
}
|
}
|
||||||
|
@@ -930,7 +930,22 @@ func Test_no_extra_indent()
|
|||||||
\ "~ ",
|
\ "~ ",
|
||||||
\ ]
|
\ ]
|
||||||
let lines = s:screen_lines2(1, 4, 20)
|
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
|
norm! gg0
|
||||||
exe ":norm! 5iword \<esc>"
|
exe ":norm! 5iword \<esc>"
|
||||||
redraw!
|
redraw!
|
||||||
|
Reference in New Issue
Block a user