changeset 16137:5a2033905f19

patch 8.1.1073: space in number column is on wrong side with 'rightleft' set commit https://github.com/vim/vim/commit/e73f911c53de1c87e39456ba20782f72a0ca8f4f Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 29 18:29:54 2019 +0100 patch 8.1.1073: space in number column is on wrong side with 'rightleft' set Problem: Space in number column is on wrong side with 'rightleft' set. Solution: Move the space to the text side. Add a test.
author Bram Moolenaar <Bram@vim.org>
date Fri, 29 Mar 2019 18:30:04 +0100
parents 95d50979389e
children 402b714cb919
files src/screen.c src/testdir/dumps/Test_diff_of_diff_02.dump src/testdir/test_diffmode.vim src/version.c
diffstat 4 files changed, 38 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -3896,7 +3896,19 @@ win_line(
 				*p_extra = '-';
 #ifdef FEAT_RIGHTLEFT
 			if (wp->w_p_rl)		    /* reverse line numbers */
-			    rl_mirror(extra);
+			{
+			    char_u	*p1, *p2;
+			    int		t;
+
+			    // like rl_mirror(), but keep the space at the end
+			    p2 = skiptowhite(extra) - 1;
+			    for (p1 = extra; p1 < p2; ++p1, --p2)
+			    {
+				t = *p1;
+				*p1 = *p2;
+				*p2 = t;
+			    }
+			}
 #endif
 			p_extra = extra;
 			c_extra = NUL;
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_diff_of_diff_02.dump
@@ -0,0 +1,20 @@
+| +0&#ffffff0@28|a>a| +0#af5f00255&|1| @1| +0#0000e05#a8a8a8255@1||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0@1| @32
+@29|b@1| +0#af5f00255&|2| @1| +0#0000e05#a8a8a8255@1||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0@1| @32
+@29|c@1| +0#af5f00255&|3| @1| +0#0000e05#a8a8a8255@1||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0@1| @32
+|-+0#4040ff13#afffff255@30| +0#af5f00255#ffffff0@3| +0#0000e05#a8a8a8255@1||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|@+0#0000000#5fd7ff255@1| |-|3|,|2| |+|5|,|7| |@@1| @19
+|-+0#4040ff13#afffff255@30| +0#af5f00255#ffffff0@3| +0#0000e05#a8a8a8255@1||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|d+0#0000000#5fd7ff255@1| @32
+|-+0#4040ff13#afffff255@30| +0#af5f00255#ffffff0@3| +0#0000e05#a8a8a8255@1||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|e+0#0000000#5fd7ff255@1| @32
+|-+0#4040ff13#afffff255@30| +0#af5f00255#ffffff0@3| +0#0000e05#a8a8a8255@1||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|f+0#0000000#5fd7ff255@1| @32
+| +0#4040ff13#ffffff0@35|~||+1#0000000&|~+0#4040ff13&| @35
+@36|~||+1#0000000&|~+0#4040ff13&| @35
+@36|~||+1#0000000&|~+0#4040ff13&| @35
+@36|~||+1#0000000&|~+0#4040ff13&| @35
+@36|~||+1#0000000&|~+0#4040ff13&| @35
+@36|~||+1#0000000&|~+0#4040ff13&| @35
+@36|~||+1#0000000&|~+0#4040ff13&| @35
+@36|~||+1#0000000&|~+0#4040ff13&| @35
+@36|~||+1#0000000&|~+0#4040ff13&| @35
+@36|~||+1#0000000&|~+0#4040ff13&| @35
+@36|~||+1#0000000&|~+0#4040ff13&| @35
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|A|l@1| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|A|l@1
+|:+0&&|s|e|t| |r|i|g|h|t|l|e|f|t| @60
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -922,6 +922,9 @@ func Test_diff_of_diff()
 
   call VerifyScreenDump(buf, 'Test_diff_of_diff_01', {})
 
+  call term_sendkeys(buf, ":set rightleft\<cr>")
+  call VerifyScreenDump(buf, 'Test_diff_of_diff_02', {})
+
   " clean up
   call StopVimInTerminal(buf)
   call delete('Xtest_diff_diff')
--- a/src/version.c
+++ b/src/version.c
@@ -776,6 +776,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1073,
+/**/
     1072,
 /**/
     1071,