comparison src/option.c @ 4736:3f2319a953b3 v7.3.1115

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)
author Bram Moolenaar <bram@vim.org>
date Tue, 04 Jun 2013 22:13:50 +0200
parents cadb57fbb781
children 66803af09906
comparison
equal deleted inserted replaced
4735:4bdece3fb6a6 4736:3f2319a953b3
7645 curbuf = save_curbuf; 7645 curbuf = save_curbuf;
7646 } 7646 }
7647 } 7647 }
7648 #endif 7648 #endif
7649 7649
7650 /* If 'number' is set, reset 'relativenumber'. */
7651 /* If 'relativenumber' is set, reset 'number'. */
7652 else if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
7653 {
7654 curwin->w_p_rnu = FALSE;
7655
7656 /* Only reset the global value if the own value is set globally. */
7657 if (((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0))
7658 curwin->w_allbuf_opt.wo_rnu = FALSE;
7659 }
7660 else if ((int *)varp == &curwin->w_p_rnu && curwin->w_p_rnu)
7661 {
7662 curwin->w_p_nu = FALSE;
7663
7664 /* Only reset the global value if the own value is set globally. */
7665 if (((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0))
7666 curwin->w_allbuf_opt.wo_nu = FALSE;
7667 }
7668 else if ((int *)varp == &curwin->w_allbuf_opt.wo_nu
7669 && curwin->w_allbuf_opt.wo_nu)
7670 {
7671 curwin->w_allbuf_opt.wo_rnu = FALSE;
7672 }
7673 else if ((int *)varp == &curwin->w_allbuf_opt.wo_rnu
7674 && curwin->w_allbuf_opt.wo_rnu)
7675 {
7676 curwin->w_allbuf_opt.wo_nu = FALSE;
7677 }
7678
7679 else if ((int *)varp == &curbuf->b_p_ro) 7650 else if ((int *)varp == &curbuf->b_p_ro)
7680 { 7651 {
7681 /* when 'readonly' is reset globally, also reset readonlymode */ 7652 /* when 'readonly' is reset globally, also reset readonlymode */
7682 if (!curbuf->b_p_ro && (opt_flags & OPT_LOCAL) == 0) 7653 if (!curbuf->b_p_ro && (opt_flags & OPT_LOCAL) == 0)
7683 readonlymode = FALSE; 7654 readonlymode = FALSE;