comparison src/window.c @ 30892:d5ad2e07a18f v9.0.0780

patch 9.0.0780: 'scroll' value computed in unexpected location Commit: https://github.com/vim/vim/commit/a1a46da87d91cfbf46866627b3e66a757145e8c3 Author: Luuk van Baal <luukvbaal@gmail.com> Date: Mon Oct 17 14:22:03 2022 +0100 patch 9.0.0780: 'scroll' value computed in unexpected location Problem: 'scroll' value computed in unexpected location. Solution: Compute 'scroll' when the window height is changed. (Luuk van Baal, closes #11387)
author Bram Moolenaar <Bram@vim.org>
date Mon, 17 Oct 2022 15:30:03 +0200
parents c7983f593fa7
children 013f8436b0d5
comparison
equal deleted inserted replaced
30891:2b1d792efdf1 30892:d5ad2e07a18f
6376 else if (wp == curwin) 6376 else if (wp == curwin)
6377 wp->w_valid &= ~VALID_CROW; 6377 wp->w_valid &= ~VALID_CROW;
6378 invalidate_botline_win(wp); 6378 invalidate_botline_win(wp);
6379 validate_botline_win(wp); 6379 validate_botline_win(wp);
6380 } 6380 }
6381 win_comp_scroll(wp);
6382 wp->w_prev_height = wp->w_height; 6381 wp->w_prev_height = wp->w_height;
6383 wp->w_prev_winrow = wp->w_winrow; 6382 wp->w_prev_winrow = wp->w_winrow;
6384 } 6383 }
6385 skip_update_topline = FALSE; 6384 skip_update_topline = FALSE;
6386 // Ensure cursor is valid when not in normal mode or when resized. 6385 // Ensure cursor is valid when not in normal mode or when resized.
6470 set_fraction(wp); 6469 set_fraction(wp);
6471 } 6470 }
6472 6471
6473 wp->w_height = height; 6472 wp->w_height = height;
6474 wp->w_skipcol = 0; 6473 wp->w_skipcol = 0;
6474 win_comp_scroll(wp);
6475 6475
6476 // There is no point in adjusting the scroll position when exiting. Some 6476 // There is no point in adjusting the scroll position when exiting. Some
6477 // values might be invalid. 6477 // values might be invalid.
6478 if (!exiting && *p_spk == 'c') 6478 if (!exiting && *p_spk == 'c')
6479 scroll_to_fraction(wp, prev_height); 6479 scroll_to_fraction(wp, prev_height);
6594 curs_columns(FALSE); // validate w_wrow 6594 curs_columns(FALSE); // validate w_wrow
6595 } 6595 }
6596 if (prev_height > 0) 6596 if (prev_height > 0)
6597 wp->w_prev_fraction_row = wp->w_wrow; 6597 wp->w_prev_fraction_row = wp->w_wrow;
6598 6598
6599 win_comp_scroll(wp);
6600 redraw_win_later(wp, UPD_SOME_VALID); 6599 redraw_win_later(wp, UPD_SOME_VALID);
6601 wp->w_redr_status = TRUE; 6600 wp->w_redr_status = TRUE;
6602 invalidate_botline_win(wp); 6601 invalidate_botline_win(wp);
6603 } 6602 }
6604 6603