From 581b2bcde0b49bd5e3931beea4c6a677bf549ed5 Mon Sep 17 00:00:00 2001 From: erw7 Date: Thu, 1 Apr 2021 20:46:12 +0900 Subject: screen: fix problem with p_ch When the screen is resized, p_ch is not re-set to the appropriate value. As a result, access to invalid addresses was occurring. --- src/nvim/screen.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 1e20b77c5c..384636f705 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -7507,6 +7507,10 @@ void screen_resize(int width, int height) Rows = height; Columns = width; check_shellsize(); + int max_p_ch = Rows - min_rows() + 1; + if (!ui_has(kUIMessages) && p_ch > max_p_ch) { + p_ch = max_p_ch ? max_p_ch : 1; + } height = Rows; width = Columns; p_lines = Rows; -- cgit