mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +00:00
vim-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: vim/vim#15911
b38700ac81
Co-authored-by: Milly <milly.ca@gmail.com>
This commit is contained in:
@@ -769,9 +769,15 @@ int get_number_indent(linenr_T lnum)
|
||||
return (int)col;
|
||||
}
|
||||
|
||||
/// Check "briopt" as 'breakindentopt' and update the members of "wp".
|
||||
/// This is called when 'breakindentopt' is changed and when a window is
|
||||
/// initialized
|
||||
bool briopt_check(win_T *wp)
|
||||
///
|
||||
/// @param briopt when NULL: use "wp->w_p_briopt"
|
||||
/// @param wp when NULL: only check "briopt"
|
||||
///
|
||||
/// @return FAIL for failure, OK otherwise.
|
||||
bool briopt_check(char *briopt, win_T *wp)
|
||||
{
|
||||
int bri_shift = 0;
|
||||
int bri_min = 20;
|
||||
@@ -779,7 +785,13 @@ bool briopt_check(win_T *wp)
|
||||
int bri_list = 0;
|
||||
int bri_vcol = 0;
|
||||
|
||||
char *p = wp->w_p_briopt;
|
||||
char *p = empty_string_option;
|
||||
if (briopt != NULL) {
|
||||
p = briopt;
|
||||
} else if (wp != NULL) {
|
||||
p = wp->w_p_briopt;
|
||||
}
|
||||
|
||||
while (*p != NUL) {
|
||||
// Note: Keep this in sync with p_briopt_values
|
||||
if (strncmp(p, "shift:", 6) == 0
|
||||
@@ -807,6 +819,10 @@ bool briopt_check(win_T *wp)
|
||||
}
|
||||
}
|
||||
|
||||
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