diff options
author | erw7 <erw7.github@gmail.com> | 2020-07-28 00:51:41 +0900 |
---|---|---|
committer | erw7 <erw7.github@gmail.com> | 2020-07-29 02:16:50 +0900 |
commit | b6b270b28fa92d5bedca397313b5370893fe0e3f (patch) | |
tree | cc4551d4868461f82bbb37130fb32ab0fda1fb6c /src/nvim/screen.c | |
parent | 33eaa171fad0c8b729b0db14eef3173dbd8c950b (diff) | |
download | rneovim-b6b270b28fa92d5bedca397313b5370893fe0e3f.tar.gz rneovim-b6b270b28fa92d5bedca397313b5370893fe0e3f.tar.bz2 rneovim-b6b270b28fa92d5bedca397313b5370893fe0e3f.zip |
terminal: fix terminal attribute overflow
fixes #11548
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index ba52f5b489..7bed747e9a 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2804,8 +2804,8 @@ win_line ( off += col; } - // wont highlight after 1024 columns - int term_attrs[1024] = {0}; + // wont highlight after TERM_ATTRS_MAX columns + int term_attrs[TERM_ATTRS_MAX] = { 0 }; if (wp->w_buffer->terminal) { terminal_get_line_attributes(wp->w_buffer->terminal, wp, lnum, term_attrs); extra_check = true; @@ -4172,7 +4172,7 @@ win_line ( int n = wp->w_p_rl ? -1 : 1; while (col >= 0 && col < grid->Columns) { schar_from_ascii(linebuf_char[off], ' '); - linebuf_attr[off] = term_attrs[vcol]; + linebuf_attr[off] = vcol >= TERM_ATTRS_MAX ? 0 : term_attrs[vcol]; off += n; vcol += n; col += n; |