aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-03-03 07:41:57 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-03-03 07:54:26 +0800
commit4a3594f60e854db56589f30cec4fc16c8a46fe30 (patch)
tree4681a10c7c86cb7fe980f4ebd59b8923a4f834c7
parentc2e602b9d0a09407179f5ccd8ff5c1a8b409280a (diff)
downloadrneovim-4a3594f60e854db56589f30cec4fc16c8a46fe30.tar.gz
rneovim-4a3594f60e854db56589f30cec4fc16c8a46fe30.tar.bz2
rneovim-4a3594f60e854db56589f30cec4fc16c8a46fe30.zip
vim-patch:9.0.0991: crash when reading help index with various options set
Problem: Crash when reading help index with various options set. (Marius Gedminas) Solution: Do not set wlv.c_extra to NUL when wlv.p_extra is NULL. (closes vim/vim#11651) https://github.com/vim/vim/commit/c67c89c7589253215d57bad588edcf83a9403560 Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--src/nvim/drawline.c2
-rw-r--r--src/nvim/testdir/test_breakindent.vim18
2 files changed, 19 insertions, 1 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index e2a0895fff..8f7928e1c9 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -2170,7 +2170,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange,
c = (n_extra == 0 && wp->w_p_lcs_chars.tab3)
? wp->w_p_lcs_chars.tab3
: wp->w_p_lcs_chars.tab1;
- if (wp->w_p_lbr) {
+ if (wp->w_p_lbr && p_extra != NULL) {
c_extra = NUL; // using p_extra from above
} else {
c_extra = wp->w_p_lcs_chars.tab2;
diff --git a/src/nvim/testdir/test_breakindent.vim b/src/nvim/testdir/test_breakindent.vim
index 2e377aa434..b61c9a570d 100644
--- a/src/nvim/testdir/test_breakindent.vim
+++ b/src/nvim/testdir/test_breakindent.vim
@@ -1075,4 +1075,22 @@ func Test_breakindent_column()
bwipeout!
endfunc
+func Test_linebreak_list()
+ " This was setting wlv.c_extra to NUL while wlv.p_extra is NULL
+ filetype plugin on
+ syntax enable
+ edit! $VIMRUNTIME/doc/index.txt
+ /v_P
+
+ setlocal list
+ setlocal listchars=tab:>-
+ setlocal linebreak
+ setlocal nowrap
+ setlocal filetype=help
+ redraw!
+
+ bwipe!
+endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab