mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -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:
committed by
Bram Moolenaar
parent
6bc30b05e6
commit
29f0dc3689
@@ -1121,8 +1121,9 @@ win_line(
|
||||
int t;
|
||||
|
||||
// like rl_mirror(), but keep the space at the end
|
||||
p2 = skiptowhite(extra) - 1;
|
||||
for (p1 = extra; p1 < p2; ++p1, --p2)
|
||||
p2 = skipwhite(extra);
|
||||
p2 = skiptowhite(p2) - 1;
|
||||
for (p1 = skipwhite(extra); p1 < p2; ++p1, --p2)
|
||||
{
|
||||
t = *p1;
|
||||
*p1 = *p2;
|
||||
|
@@ -298,4 +298,26 @@ func Test_relativenumber_colors()
|
||||
call delete('XTest_relnr')
|
||||
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
|
||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
3012,
|
||||
/**/
|
||||
3011,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user