summaryrefslogtreecommitdiff
path: root/src/message.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-02-01 17:12:25 +0100
committerBram Moolenaar <Bram@vim.org>2011-02-01 17:12:25 +0100
commitacf1728ef5ca881daaefd0819e66bd59efb35762 (patch)
tree99f6edc924eadff20c660b0b2d2e9f1baaeb997f /src/message.c
parentc98d5ee92307fbc143e63da19102f2c659962b8c (diff)
downloadvim-acf1728ef5ca881daaefd0819e66bd59efb35762.zip
updated for version 7.3.110
Problem: The "nbsp" item in 'listchars' isn't used for ":list". Solution: Make it work. (Christian Brabandt)
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/message.c b/src/message.c
index 009472504..07e734be9 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1637,8 +1637,16 @@ msg_prt_line(s, list)
else if (has_mbyte && (l = (*mb_ptr2len)(s)) > 1)
{
col += (*mb_ptr2cells)(s);
- mch_memmove(buf, s, (size_t)l);
- buf[l] = NUL;
+ if (lcs_nbsp != NUL && list && mb_ptr2char(s) == 160)
+ {
+ mb_char2bytes(lcs_nbsp, buf);
+ buf[(*mb_ptr2len)(buf)] = NUL;
+ }
+ else
+ {
+ mch_memmove(buf, s, (size_t)l);
+ buf[l] = NUL;
+ }
msg_puts(buf);
s += l;
continue;
@@ -1664,6 +1672,11 @@ msg_prt_line(s, list)
attr = hl_attr(HLF_8);
}
}
+ else if (c == 160 && list && lcs_nbsp != NUL)
+ {
+ c = lcs_nbsp;
+ attr = hl_attr(HLF_8);
+ }
else if (c == NUL && list && lcs_eol != NUL)
{
p_extra = (char_u *)"";