fix(diff): avoid restoring invalid 'foldcolumn' value (#21650)

Use "0" for 'foldcolumn' when w_p_fdc_save is empty, like how
"manual" is used for 'foldmethod' when w_p_fdm_save is empty.
This commit is contained in:
zeertzjq
2023-01-05 07:12:02 +08:00
committed by GitHub
parent 89232b8b48
commit ae64772a88
2 changed files with 23 additions and 1 deletions

View File

@@ -1502,7 +1502,7 @@ void ex_diffoff(exarg_T *eap)
free_string_option(wp->w_p_fdm);
wp->w_p_fdm = xstrdup(*wp->w_p_fdm_save ? wp->w_p_fdm_save : "manual");
free_string_option(wp->w_p_fdc);
wp->w_p_fdc = xstrdup(wp->w_p_fdc_save);
wp->w_p_fdc = xstrdup(*wp->w_p_fdc_save ? wp->w_p_fdc_save : "0");
if (wp->w_p_fdl == 0) {
wp->w_p_fdl = wp->w_p_fdl_save;