0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 9.0.1938: multispace wrong when scrolling horizontally

Problem:  multispace wrong when scrolling horizontally
Solution: Update position in "multispace" or "leadmultispace" also in
          skipped chars. Reorder conditions to be more consistent.

closes: #13145
closes: #13147

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
zeertzjq
2023-09-24 23:32:18 +02:00
committed by Christian Brabandt
parent 46a0582ffa
commit abc808112e
4 changed files with 129 additions and 125 deletions

View File

@@ -2005,10 +2005,13 @@ msg_prt_line(char_u *s, int list)
{
attr = 0;
c = *s++;
in_multispace = c == ' '
&& ((col > 0 && s[-2] == ' ') || *s == ' ');
if (!in_multispace)
multispace_pos = 0;
if (list)
{
in_multispace = c == ' ' && (*s == ' '
|| (col > 0 && s[-2] == ' '));
if (!in_multispace)
multispace_pos = 0;
}
if (c == TAB && (!list || curwin->w_lcs_chars.tab1))
{
// tab amount depends on current column
@@ -2062,7 +2065,7 @@ msg_prt_line(char_u *s, int list)
}
else if (c == ' ')
{
if (list && lead != NULL && s <= lead && in_multispace
if (lead != NULL && s <= lead && in_multispace
&& curwin->w_lcs_chars.leadmultispace != NULL)
{
c = curwin->w_lcs_chars.leadmultispace[multispace_pos++];
@@ -2082,7 +2085,7 @@ msg_prt_line(char_u *s, int list)
c = curwin->w_lcs_chars.trail;
attr = HL_ATTR(HLF_8);
}
else if (list && in_multispace
else if (in_multispace
&& curwin->w_lcs_chars.multispace != NULL)
{
c = curwin->w_lcs_chars.multispace[multispace_pos++];