diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-09-24 23:32:18 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-09-24 23:32:18 +0200 |
commit | abc808112ee5df58a9f612f2bb5a65389c2c14e1 (patch) | |
tree | 2af294f535b972a9da4430e3b56a82fbc1714878 /src/message.c | |
parent | 46a0582ffa4ea79b112ac01e25adccf93b49cd9d (diff) |
patch 9.0.1938: multispace wrong when scrolling horizontallyv9.0.1938
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>
Diffstat (limited to 'src/message.c')
-rw-r--r-- | src/message.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/message.c b/src/message.c index 98a362411e..2fc6cefa9d 100644 --- a/src/message.c +++ b/src/message.c @@ -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++]; |