diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5132,7 +5132,18 @@
 	characters are put before the number.
 	See |hl-LineNr|  and |hl-CursorLineNr| for the highlighting used for
 	the number.
-	When setting this option, 'relativenumber' is reset.
+						*number_relativenumber*
+	The number in front of the cursor line depends on the values of the
+	'rnu' and 'nu' setting:
+
+       Option:	'nonu'          'nu'            'nonu'          'nu'
+		'nornu'         'nornu'         'rnu'           'rnu'
+
+	Text:
+	    |apple          |  1 apple      |  2 apple      |  2 apple
+	    |pear           |  2 pear       |  1 pear       |  1 pear
+	    |nobod[y]       |  3 nobod[y]   |  0 nobod[y]   |3   nobod[y]
+	    |there          |  4 there      |  1 there      |  1 there
 
 						*'numberwidth'* *'nuw'*
 'numberwidth' 'nuw'	number	(Vim default: 4  Vi default: 8)
@@ -5547,7 +5558,9 @@
 	characters are put before the number.
 	See |hl-LineNr|  and |hl-CursorLineNr| for the highlighting used for
 	the number.
-	When setting this option, 'number' is reset.
+	
+	The number in front of the cursor line depends on the value of
+	'number' and 'relativenumber' |number_relativenumber|.
 
 						*'remap'* *'noremap'*
 'remap'			boolean	(default on)
diff --git a/src/option.c b/src/option.c
--- a/src/option.c
+++ b/src/option.c
@@ -7647,35 +7647,6 @@
     }
 #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 */
diff --git a/src/screen.c b/src/screen.c
--- a/src/screen.c
+++ b/src/screen.c
@@ -2329,14 +2329,14 @@
 	    if (len > w + 1)
 		len = w + 1;
 
-	    if (wp->w_p_nu)
+	    if (wp->w_p_nu && !wp->w_p_rnu)
 		/* 'number' */
 		num = (long)lnum;
 	    else
 	    {
 		/* 'relativenumber', don't use negative numbers */
 		num = labs((long)get_cursor_rel_lnum(wp, lnum));
-		if (num == 0)
+		if (num == 0 && wp->w_p_nu && wp->w_p_rnu)
 		{
 		    num = lnum;
 		    fmt = "%-*ld ";
@@ -3499,14 +3499,14 @@
 			long num;
 			char *fmt = "%*ld ";
 
-			if (wp->w_p_nu)
+			if (wp->w_p_nu && !wp->w_p_rnu)
 			    /* 'number' */
 			    num = (long)lnum;
 			else
 			{
 			    /* 'relativenumber', don't use negative numbers */
 			    num = labs((long)get_cursor_rel_lnum(wp, lnum));
-			    if (num == 0)
+			    if (num == 0 && wp->w_p_nu && wp->w_p_rnu)
 			    {
 				num = lnum;
 				fmt = "%-*ld ";
@@ -10260,7 +10260,10 @@
     int		n;
     linenr_T	lnum;
 
-    lnum = wp->w_buffer->b_ml.ml_line_count;
+    if (wp->w_p_rnu && !wp->w_p_nu)
+	lnum = wp->w_height;
+    else
+	lnum = wp->w_buffer->b_ml.ml_line_count;
 
     if (lnum == wp->w_nrwidth_line_count)
 	return wp->w_nrwidth_width;
diff --git a/src/testdir/test89.ok b/src/testdir/test89.ok
--- a/src/testdir/test89.ok
+++ b/src/testdir/test89.ok
@@ -1,9 +1,9 @@
 results:
 
-nonumber
+  number
   relativenumber
 
-nonumber
+  number
   relativenumber
 :setlocal must NOT reset the other global value
 
@@ -12,11 +12,11 @@
   relativenumber
 :setglobal MUST reset the other global value
 
-nonumber
+  number
 
-norelativenumber
+  relativenumber
 :set MUST reset the other global value
 
-nonumber
+  number
 
-norelativenumber
+  relativenumber
On Mi, 29 Mai 2013, Ben Fritz wrote:
> I like the proposal by "glts" myself:
> 
> > - ":set nonu nornu" means: I don't want any line numbers;
> > - ":set nu nornu" means: I want to see only absolute numbers;
> > - ":set nonu rnu" means: I want to see only relative numbers;
> > - ":set nu rnu" means: I want to have the best of both worlds.
> 
> Christian, what is the problem you have with this approach?
I think, this is confusing. But as I said, I don't have a strong opinion 
on that, so here is a patch to try out:
regards,
Christian
-- 
Wie man sein Kind nicht nennen sollte: 
  Bill Jard 
-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
--- 
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Wednesday, May 29, 2013
Subscribe to:
Post Comments (Atom)
 
No comments:
Post a Comment