forked from aniani/vim
updated for version 7.3.1115
Problem: Many users don't like the cursor line number when 'relativenumber' is set. Solution: Have four combinations with 'number' and 'relativenumber'. (Christian Brabandt)
This commit is contained in:
29
src/option.c
29
src/option.c
@@ -7647,35 +7647,6 @@ set_bool_option(opt_idx, varp, value, opt_flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If 'number' is set, reset 'relativenumber'. */
|
||||
/* If 'relativenumber' is set, reset 'number'. */
|
||||
else if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
|
||||
{
|
||||
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;
|
||||
}
|
||||
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)
|
||||
{
|
||||
/* when 'readonly' is reset globally, also reset readonlymode */
|
||||
|
Reference in New Issue
Block a user