aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-03-01 16:43:06 +0100
committerMatthieu Coudron <mattator@gmail.com>2020-03-01 16:45:51 +0100
commit4ffae76520c924fa9f3d5f9850f84c89c002877c (patch)
treeef34989022a6590680efacc2068aec89de5312a1
parent1a2be57da3f7e33af4e4eb3e0d36569feea71253 (diff)
downloadrneovim-4ffae76520c924fa9f3d5f9850f84c89c002877c.tar.gz
rneovim-4ffae76520c924fa9f3d5f9850f84c89c002877c.tar.bz2
rneovim-4ffae76520c924fa9f3d5f9850f84c89c002877c.zip
addressing reviews
-rw-r--r--src/nvim/ex_cmds.c2
-rw-r--r--src/nvim/option.c1
-rw-r--r--src/nvim/window.c9
3 files changed, 4 insertions, 8 deletions
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:<NUM>
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';
}