aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2020-07-28 00:51:41 +0900
committererw7 <erw7.github@gmail.com>2020-07-29 02:16:50 +0900
commitb6b270b28fa92d5bedca397313b5370893fe0e3f (patch)
treecc4551d4868461f82bbb37130fb32ab0fda1fb6c /src/nvim/screen.c
parent33eaa171fad0c8b729b0db14eef3173dbd8c950b (diff)
downloadrneovim-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.c6
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;