0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed

Problem:    When 'rightleft' is set the line number is sometimes drawn
            reversed.
Solution:   Adjust how space is handled. (Christian Brabandt, closes #8389,
            closes #8391)
This commit is contained in:
Christian Brabandt
2021-06-16 19:28:34 +02:00
committed by Bram Moolenaar
parent 6bc30b05e6
commit 29f0dc3689
3 changed files with 27 additions and 2 deletions

View File

@@ -1121,8 +1121,9 @@ win_line(
int t; int t;
// like rl_mirror(), but keep the space at the end // like rl_mirror(), but keep the space at the end
p2 = skiptowhite(extra) - 1; p2 = skipwhite(extra);
for (p1 = extra; p1 < p2; ++p1, --p2) p2 = skiptowhite(p2) - 1;
for (p1 = skipwhite(extra); p1 < p2; ++p1, --p2)
{ {
t = *p1; t = *p1;
*p1 = *p2; *p1 = *p2;

View File

@@ -298,4 +298,26 @@ func Test_relativenumber_colors()
call delete('XTest_relnr') call delete('XTest_relnr')
endfunc endfunc
" Test for displaying line numbers with 'rightleft'
func Test_number_rightleft()
CheckFeature rightleft
new
setlocal number
setlocal rightleft
call setline(1, range(1, 1000))
normal! 9Gzt
redraw!
call assert_match('^\s\+9 9$', Screenline(1))
normal! 10Gzt
redraw!
call assert_match('^\s\+01 10$', Screenline(1))
normal! 100Gzt
redraw!
call assert_match('^\s\+001 100$', Screenline(1))
normal! 1000Gzt
redraw!
call assert_match('^\s\+0001 1000$', Screenline(1))
bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab " vim: shiftwidth=2 sts=2 expandtab

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3012,
/**/ /**/
3011, 3011,
/**/ /**/