aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2017-05-05 10:40:32 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2017-05-05 10:55:07 +0200
commit443399c27d63fea7b837af700a6f3142e96adb22 (patch)
tree71c679025a98f550c97775455fcc8889179617fa
parent631d55ada04bfeaedabb5bf43092457c5f78b8a5 (diff)
downloadrneovim-443399c27d63fea7b837af700a6f3142e96adb22.tar.gz
rneovim-443399c27d63fea7b837af700a6f3142e96adb22.tar.bz2
rneovim-443399c27d63fea7b837af700a6f3142e96adb22.zip
options: consolidate updates for window string options affected by copy_winopt
update note at options.c head about window options
-rw-r--r--src/nvim/buffer.c2
-rw-r--r--src/nvim/option.c11
-rw-r--r--src/nvim/window.c2
3 files changed, 12 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 7def8c1684..ebe50c6d31 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -2316,7 +2316,7 @@ void get_winopts(buf_T *buf)
/* Set 'foldlevel' to 'foldlevelstart' if it's not negative. */
if (p_fdls >= 0)
curwin->w_p_fdl = p_fdls;
- check_colorcolumn(curwin);
+ didset_window_options(curwin);
}
/*
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 3658f17883..95e9844187 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -8,6 +8,9 @@
// - Add a BV_XX or WV_XX entry to option_defs.h
// - Add a variable to the window or buffer struct in buffer_defs.h.
// - For a window option, add some code to copy_winopt().
+// - For a window string option, add code to check_winopt()
+// and clear_winopt(). If setting the option needs parsing,
+// add some code to didset_window_options().
// - For a buffer option, add some code to buf_copy_options().
// - For a buffer string option, add code to check_buf_options().
// - If it's a numeric option, add any necessary bounds checks to do_set().
@@ -5514,7 +5517,6 @@ void win_copy_options(win_T *wp_from, win_T *wp_to)
copy_winopt(&wp_from->w_allbuf_opt, &wp_to->w_allbuf_opt);
/* Is this right? */
wp_to->w_farsi = wp_from->w_farsi;
- briopt_check(wp_to);
}
/*
@@ -5616,6 +5618,13 @@ void clear_winopt(winopt_T *wop)
clear_string_option(&wop->wo_briopt);
}
+void didset_window_options(win_T *wp)
+{
+ check_colorcolumn(wp);
+ briopt_check(wp);
+}
+
+
/*
* Copy global option values to local options for one buffer.
* Used when creating a new buffer and sometimes when entering a buffer.
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 69c0a838ea..85f3667b6b 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -1043,7 +1043,7 @@ static void win_init(win_T *newp, win_T *oldp, int flags)
win_init_some(newp, oldp);
- check_colorcolumn(newp);
+ didset_window_options(newp);
}
/*