summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-03-13 20:42:32 +0100
committerBram Moolenaar <Bram@vim.org>2013-03-13 20:42:32 +0100
commit20754027b3b8c29dfc5ee0b5dfa6a5459ea6b903 (patch)
treedd5dcdaf366c36f77f642dfe0b49a0e7f1383d41 /src/option.c
parent1e284f515581e0516e3f3dea568b9b9084bbcab1 (diff)
downloadvim-git-20754027b3b8c29dfc5ee0b5dfa6a5459ea6b903.tar.gz
updated for version 7.3.861v7.3.861
Problem: ":setlocal number" clears global value of 'relativenumber'. Solution: Do it properly. (Markus Heidelberg)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/option.c b/src/option.c
index f9d9fd5c2..467d578a6 100644
--- a/src/option.c
+++ b/src/option.c
@@ -7631,22 +7631,33 @@ set_bool_option(opt_idx, varp, value, opt_flags)
}
#endif
- /* 'number', 'relativenumber' */
- else if ((int *)varp == &curwin->w_p_nu
- || (int *)varp == &curwin->w_p_rnu)
+ /* If 'number' is set, reset 'relativenumber'. */
+ /* If 'relativenumber' is set, reset 'number'. */
+ else if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
{
- /* If 'number' is set, reset 'relativenumber'. */
- /* If 'relativenumber' is set, reset 'number'. */
- if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
- {
- curwin->w_p_rnu = FALSE;
+ curwin->w_p_rnu = FALSE;
+
+ /* Only reset the global value if the own value is set globally. */
+ if (((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0))
curwin->w_allbuf_opt.wo_rnu = FALSE;
- }
- if ((int *)varp == &curwin->w_p_rnu && curwin->w_p_rnu)
- {
- curwin->w_p_nu = FALSE;
+ }
+ else if ((int *)varp == &curwin->w_p_rnu && curwin->w_p_rnu)
+ {
+ curwin->w_p_nu = FALSE;
+
+ /* Only reset the global value if the own value is set globally. */
+ if (((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0))
curwin->w_allbuf_opt.wo_nu = FALSE;
- }
+ }
+ else if ((int *)varp == &curwin->w_allbuf_opt.wo_nu
+ && curwin->w_allbuf_opt.wo_nu)
+ {
+ curwin->w_allbuf_opt.wo_rnu = FALSE;
+ }
+ else if ((int *)varp == &curwin->w_allbuf_opt.wo_rnu
+ && curwin->w_allbuf_opt.wo_rnu)
+ {
+ curwin->w_allbuf_opt.wo_nu = FALSE;
}
else if ((int *)varp == &curbuf->b_p_ro)