On Sa, 15 Jan 2022, Dominique Pellé wrote:
> option.c:7062:9: warning: code will never be executed [-Wunreachable-code]
> if (buf->b_p_flp == NULL || *buf->b_p_flp == NUL)
> ^~~
Ooops that was a first version and should have been removed.
Here is another patch on top of that:
```patch
diff --git a/src/option.c b/src/option.c
index 0a75c2417..ff539683e 100644
--- 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
index 2ac127dd5..eefaa6269 100644
--- 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 \<esc>"
redraw!
```
Or may be we do not even need this special case of using the global
formatlistpattern when the local formatlistpattern is null ? Not sure.
Best,
Christian
--
Jeder klagt über sein Gedächnis, aber niemand über seinen Verstand.
-- François de La Rochefoucauld
--
--
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/20220115175725.GB155892%40256bit.org.