diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2019-01-23 01:41:00 +0100 |
---|---|---|
committer | Marco Hinz <mh.codebro@gmail.com> | 2019-01-26 14:45:47 +0100 |
commit | 352811fe5ff900e8d95695477dff821a5b860912 (patch) | |
tree | 94e91687fada2afefa3eee857473af5eb6a3f03f /src/nvim/message.c | |
parent | ec5a4d862d71729569acf4afac4c371a09edc314 (diff) | |
download | rneovim-352811fe5ff900e8d95695477dff821a5b860912.tar.gz rneovim-352811fe5ff900e8d95695477dff821a5b860912.tar.bz2 rneovim-352811fe5ff900e8d95695477dff821a5b860912.zip |
options: make 'fillchars'/'listchars' local to window
Using 'listchars' is a nice way to highlight tabs that were included by accident
for buffers that set 'expandtab'.
But maybe one does not want this for buffers that set 'noexpandtab', so now one
can use:
autocmd FileType go let &l:listchars .= ',tab: '
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r-- | src/nvim/message.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index 0f8ff74b12..4bcc58fc99 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1527,7 +1527,7 @@ void msg_prt_line(char_u *s, int list) list = TRUE; /* find start of trailing whitespace */ - if (list && lcs_trail) { + if (list && curwin->w_p_lcs_chars.trail) { trail = s + STRLEN(s); while (trail > s && ascii_iswhite(trail[-1])) --trail; @@ -1535,7 +1535,7 @@ void msg_prt_line(char_u *s, int list) /* output a space for an empty line, otherwise the line will be * overwritten */ - if (*s == NUL && !(list && lcs_eol != NUL)) + if (*s == NUL && !(list && curwin->w_p_lcs_chars.eol != NUL)) msg_putchar(' '); while (!got_int) { @@ -1550,9 +1550,9 @@ void msg_prt_line(char_u *s, int list) } else if ((l = utfc_ptr2len(s)) > 1) { col += utf_ptr2cells(s); char buf[MB_MAXBYTES + 1]; - if (lcs_nbsp != NUL && list + if (curwin->w_p_lcs_chars.nbsp != NUL && list && (utf_ptr2char(s) == 160 || utf_ptr2char(s) == 0x202f)) { - utf_char2bytes(lcs_nbsp, (char_u *)buf); + utf_char2bytes(curwin->w_p_lcs_chars.nbsp, (char_u *)buf); buf[utfc_ptr2len((char_u *)buf)] = NUL; } else { memmove(buf, s, (size_t)l); @@ -1564,25 +1564,25 @@ void msg_prt_line(char_u *s, int list) } else { attr = 0; c = *s++; - if (c == TAB && (!list || lcs_tab1)) { + if (c == TAB && (!list || curwin->w_p_lcs_chars.tab1)) { /* tab amount depends on current column */ n_extra = curbuf->b_p_ts - col % curbuf->b_p_ts - 1; if (!list) { c = ' '; c_extra = ' '; } else { - c = lcs_tab1; - c_extra = lcs_tab2; + c = curwin->w_p_lcs_chars.tab1; + c_extra = curwin->w_p_lcs_chars.tab2; attr = HL_ATTR(HLF_8); } - } else if (c == 160 && list && lcs_nbsp != NUL) { - c = lcs_nbsp; + } else if (c == 160 && list && curwin->w_p_lcs_chars.nbsp != NUL) { + c = curwin->w_p_lcs_chars.nbsp; attr = HL_ATTR(HLF_8); - } else if (c == NUL && list && lcs_eol != NUL) { + } else if (c == NUL && list && curwin->w_p_lcs_chars.eol != NUL) { p_extra = (char_u *)""; c_extra = NUL; n_extra = 1; - c = lcs_eol; + c = curwin->w_p_lcs_chars.eol; attr = HL_ATTR(HLF_AT); s--; } else if (c != NUL && (n = byte2cells(c)) > 1) { @@ -1594,10 +1594,10 @@ void msg_prt_line(char_u *s, int list) * the same in plain text. */ attr = HL_ATTR(HLF_8); } else if (c == ' ' && trail != NULL && s > trail) { - c = lcs_trail; + c = curwin->w_p_lcs_chars.trail; attr = HL_ATTR(HLF_8); - } else if (c == ' ' && list && lcs_space != NUL) { - c = lcs_space; + } else if (c == ' ' && list && curwin->w_p_lcs_chars.space != NUL) { + c = curwin->w_p_lcs_chars.space; attr = HL_ATTR(HLF_8); } } @@ -1955,7 +1955,8 @@ static void msg_scroll_up(void) if (dy_flags & DY_MSGSEP) { if (msg_scrolled == 0) { grid_fill(&default_grid, Rows-p_ch-1, Rows-p_ch, 0, (int)Columns, - fill_msgsep, fill_msgsep, HL_ATTR(HLF_MSGSEP)); + curwin->w_p_fcs_chars.msgsep, curwin->w_p_fcs_chars.msgsep, + HL_ATTR(HLF_MSGSEP)); } int nscroll = MIN(msg_scrollsize()+1, Rows); grid_del_lines(&default_grid, Rows-nscroll, 1, Rows, 0, Columns); |