vim-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.
e73f911c53
This commit is contained in:
Jan Edmund Lazo 2019-03-31 11:00:14 -04:00
parent 157034bd6c
commit c5db02d792
2 changed files with 12 additions and 2 deletions

View File

@ -2772,8 +2772,15 @@ win_line (
if (wp->w_skipcol > 0)
for (p_extra = extra; *p_extra == ' '; ++p_extra)
*p_extra = '-';
if (wp->w_p_rl) /* reverse line numbers */
rl_mirror(extra);
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--) {
const int t = *p1;
*p1 = *p2;
*p2 = t;
}
}
p_extra = extra;
c_extra = NUL;
c_final = NUL;

View File

@ -763,6 +763,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')