From b92ed35a0bb873589bba9b51fdb92ffd00dc3e57 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 1 Apr 2022 18:12:55 +0800 Subject: vim-patch:8.2.4093: cached breakindent values not initialized properly Problem: Cached breakindent values not initialized properly. Solution: Initialize and cache formatlistpat. (Christian Brabandt, closes vim/vim#9526, closes vim/vim#9512) https://github.com/vim/vim/commit/c53b467473160b5cfce77277fbae414bf43e66ce Co-authored-by: Christian Brabandt --- src/nvim/option.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index 8de86ce76e..dc9f01ff60 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -5220,6 +5220,18 @@ unsigned int get_bkc_value(buf_T *buf) return buf->b_bkc_flags ? buf->b_bkc_flags : bkc_flags; } +/// Get the local or global value of 'formatlistpat'. +/// +/// @param buf The buffer. +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) { + return p_flp; + } + return buf->b_p_flp; +} + /// Get the local or global value of the 'virtualedit' flags. unsigned int get_ve_flags(void) { -- cgit From 8b43091392ec895c77b83ff5964cd37b54976089 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 1 Apr 2022 18:31:19 +0800 Subject: 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) https://github.com/vim/vim/commit/04b871da800768287a8a432de568b11297db8686 --- src/nvim/option.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index dc9f01ff60..8142be4eb1 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -5225,7 +5225,6 @@ unsigned int get_bkc_value(buf_T *buf) /// @param buf The buffer. 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) { return p_flp; } -- cgit