diff options
author | erw7 <erw7.github@gmail.com> | 2021-04-01 20:46:12 +0900 |
---|---|---|
committer | erw7 <erw7.github@gmail.com> | 2021-04-03 15:27:46 +0900 |
commit | 581b2bcde0b49bd5e3931beea4c6a677bf549ed5 (patch) | |
tree | ce184d5be781430f106b1aa25f318f2cc972ddda /src | |
parent | a177820420d3de1614bff01321c0a54a2327fab3 (diff) | |
download | rneovim-581b2bcde0b49bd5e3931beea4c6a677bf549ed5.tar.gz rneovim-581b2bcde0b49bd5e3931beea4c6a677bf549ed5.tar.bz2 rneovim-581b2bcde0b49bd5e3931beea4c6a677bf549ed5.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |