diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-10-01 17:21:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 17:21:41 +0200 |
commit | a9851bfbb1bd442fa4fbe470e1c134a1b6e9b13f (patch) | |
tree | b424a05246dde57febd58ec1d3ea878d2c90f0bc /src | |
parent | 36a5c394a59d333bf26780d03f182e79e73d33f5 (diff) | |
parent | 8154c77bef1327aca76b83a1ec5177510f6b4b7b (diff) | |
download | rneovim-a9851bfbb1bd442fa4fbe470e1c134a1b6e9b13f.tar.gz rneovim-a9851bfbb1bd442fa4fbe470e1c134a1b6e9b13f.tar.bz2 rneovim-a9851bfbb1bd442fa4fbe470e1c134a1b6e9b13f.zip |
Merge pull request #13014 from erw7/fix-fold
screen.c: fix buffer overflow due to folding
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index f3fdafcc70..3503348049 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2822,6 +2822,16 @@ win_line ( n_extra = wp->w_p_rl ? (col + 1) : (grid->Columns - col); } + if (draw_state == WL_LINE + && foldinfo.fi_level != 0 + && foldinfo.fi_lines > 0 + && col >= grid->Columns + && n_extra != 0 + && row == startrow) { + // Truncate the folding. + n_extra = 0; + } + if (draw_state == WL_LINE && (area_highlighting || has_spell)) { // handle Visual or match highlighting in this line if (vcol == fromcol |