vim-patch:8.2.3012: when 'rightleft' is set the line number is drawn reversed (#14839)

Problem:    When 'rightleft' is set the line number is sometimes drawn
            reversed.
Solution:   Adjust how space is handled. (Christian Brabandt, closes vim/vim#8389,
            closes vim/vim#8391)
29f0dc3689
This commit is contained in:
Jan Edmund Lazo
2021-06-17 22:00:26 -04:00
committed by GitHub
parent a03ffe1602
commit e2d3ad7bc4
2 changed files with 28 additions and 2 deletions

View File

@@ -2757,8 +2757,9 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow,
}
if (wp->w_p_rl) { // reverse line numbers
// like rl_mirror(), but keep the space at the end
char_u *p2 = skiptowhite(extra) - 1;
for (char_u *p1 = extra; p1 < p2; p1++, p2--) {
char_u *p2 = skipwhite(extra);
p2 = skiptowhite(p2) - 1;
for (char_u *p1 = skipwhite(extra); p1 < p2; p1++, p2--) {
const int t = *p1;
*p1 = *p2;
*p2 = t;