aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/screen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index fb019a4d2d..e2dee154df 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -5372,8 +5372,11 @@ void grid_puts_len(ScreenGrid *grid, char_u *text, int textlen, int row,
screen_adjust_grid(&grid, &row, &col);
- // safety check
- if (grid->chars == NULL || row >= grid->Rows || col >= grid->Columns) {
+ // Safety check. The check for negative row and column is to fix issue
+ // vim/vim#4102. TODO: find out why row/col could be negative.
+ if (grid->chars == NULL
+ || row >= grid->Rows || row < 0
+ || col >= grid->Columns || col < 0) {
return;
}