diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index fb21774f14..3c286de119 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4483,7 +4483,7 @@ prepare_tagpreview ( RESET_BINDING(curwin); /* don't take over 'scrollbind' and 'cursorbind' */ curwin->w_p_diff = false; // no 'diff' - set_string_option_direct((char_u *)"fdc", -1, + set_string_option_direct((char_u *)"fdc", -1, // no 'foldcolumn' (char_u *)"0", OPT_FREE, SID_NONE); return true; } diff --git a/src/nvim/option.c b/src/nvim/option.c index e990cb5214..ae103aae15 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2325,7 +2325,6 @@ void check_buf_options(buf_T *buf) * Does NOT check for P_ALLOCED flag! */ void free_string_option(char_u *p) - { if (p != empty_option) { xfree(p); diff --git a/src/nvim/window.c b/src/nvim/window.c index df0033a203..f61a46996d 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -694,18 +694,15 @@ void win_check_anchored_floats(win_T *win) } } -/// Return the number of requested fold columns, based on current -/// folds signs and on user configuration. +/// Return the number of fold columns to display int win_fdccol_count(win_T *wp) { const char *fdc = (const char *)wp->w_p_fdc; // auto: if (strncmp(fdc, "auto:", 5) == 0) { - int needed_fdccols; - needed_fdccols = getDeepestNesting(wp); - int maximum = fdc[5] - '0'; - return MIN(maximum, needed_fdccols); + int needed_fdccols = getDeepestNesting(wp); + return MIN(fdc[5] - '0', needed_fdccols); } else { return fdc[0] - '0'; }