patch 9.1.0806: tests: no error check when setting global 'briopt'
Problem: tests: no error check when setting global 'briopt' Solution: also parse and check global 'briopt' value (Milly) closes: #15911 Signed-off-by: Milly <milly.ca@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
231480f975
commit
b38700ac81
15
src/indent.c
15
src/indent.c
@ -869,11 +869,15 @@ get_number_indent(linenr_T lnum)
|
||||
|
||||
#if defined(FEAT_LINEBREAK) || defined(PROTO)
|
||||
/*
|
||||
* Check "briopt" as 'breakindentopt' and update the members of "wp".
|
||||
* This is called when 'breakindentopt' is changed and when a window is
|
||||
* initialized.
|
||||
* Returns FAIL for failure, OK otherwise.
|
||||
*/
|
||||
int
|
||||
briopt_check(win_T *wp)
|
||||
briopt_check(
|
||||
char_u *briopt, // when NULL: use "wp->w_p_briopt"
|
||||
win_T *wp) // when NULL: only check "briopt"
|
||||
{
|
||||
char_u *p;
|
||||
int bri_shift = 0;
|
||||
@ -882,7 +886,11 @@ briopt_check(win_T *wp)
|
||||
int bri_list = 0;
|
||||
int bri_vcol = 0;
|
||||
|
||||
p = wp->w_p_briopt;
|
||||
if (briopt != NULL)
|
||||
p = briopt;
|
||||
else
|
||||
p = wp->w_p_briopt;
|
||||
|
||||
while (*p != NUL)
|
||||
{
|
||||
// Note: Keep this in sync with p_briopt_values
|
||||
@ -918,6 +926,9 @@ briopt_check(win_T *wp)
|
||||
++p;
|
||||
}
|
||||
|
||||
if (wp == NULL)
|
||||
return OK;
|
||||
|
||||
wp->w_briopt_shift = bri_shift;
|
||||
wp->w_briopt_min = bri_min;
|
||||
wp->w_briopt_sbr = bri_sbr;
|
||||
|
||||
Reference in New Issue
Block a user