Mercurial > vim
comparison src/window.c @ 32363:c114eebb5268 v9.0.1513
patch 9.0.1513: text scrolls unnecessarily when splitting
Commit: https://github.com/vim/vim/commit/b926bf47d61360a4ec5e4867714a08d70fd49965
Author: Luuk van Baal <luukvbaal@gmail.com>
Date: Sat May 6 12:53:50 2023 +0100
patch 9.0.1513: text scrolls unnecessarily when splitting
Problem: Text scrolls unnecessarily when splitting and 'splitkeep' is not
"cursor".
Solution: Avoid resetting w_skipcol. (Luuk van Baal, closes #12334)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 06 May 2023 14:00:04 +0200 |
parents | 23d44be6ec20 |
children | bfc23ba1bba5 |
comparison
equal
deleted
inserted
replaced
32362:ab5eff34fb12 | 32363:c114eebb5268 |
---|---|
1451 newp->w_prevdir = (oldp->w_prevdir == NULL) | 1451 newp->w_prevdir = (oldp->w_prevdir == NULL) |
1452 ? NULL : vim_strsave(oldp->w_prevdir); | 1452 ? NULL : vim_strsave(oldp->w_prevdir); |
1453 | 1453 |
1454 if (*p_spk != 'c') | 1454 if (*p_spk != 'c') |
1455 { | 1455 { |
1456 if (*p_spk == 't') | |
1457 newp->w_skipcol = oldp->w_skipcol; | |
1456 newp->w_botline = oldp->w_botline; | 1458 newp->w_botline = oldp->w_botline; |
1457 newp->w_prev_height = oldp->w_height - WINBAR_HEIGHT(oldp); | 1459 newp->w_prev_height = oldp->w_height - WINBAR_HEIGHT(oldp); |
1458 newp->w_prev_winrow = oldp->w_winrow + 2 * WINBAR_HEIGHT(oldp); | 1460 newp->w_prev_winrow = oldp->w_winrow + 2 * WINBAR_HEIGHT(oldp); |
1459 } | 1461 } |
1460 | 1462 |
6858 if (wp->w_wrow != wp->w_prev_fraction_row) | 6860 if (wp->w_wrow != wp->w_prev_fraction_row) |
6859 set_fraction(wp); | 6861 set_fraction(wp); |
6860 } | 6862 } |
6861 | 6863 |
6862 wp->w_height = height; | 6864 wp->w_height = height; |
6863 wp->w_skipcol = 0; | |
6864 wp->w_redr_status = TRUE; | 6865 wp->w_redr_status = TRUE; |
6865 win_comp_scroll(wp); | 6866 win_comp_scroll(wp); |
6866 | 6867 |
6867 // There is no point in adjusting the scroll position when exiting. Some | 6868 // There is no point in adjusting the scroll position when exiting. Some |
6868 // values might be invalid. | 6869 // values might be invalid. |
6869 if (!exiting && *p_spk == 'c') | 6870 if (!exiting && *p_spk == 'c') |
6871 { | |
6872 wp->w_skipcol = 0; | |
6870 scroll_to_fraction(wp, prev_height); | 6873 scroll_to_fraction(wp, prev_height); |
6874 } | |
6871 } | 6875 } |
6872 | 6876 |
6873 void | 6877 void |
6874 scroll_to_fraction(win_T *wp, int prev_height) | 6878 scroll_to_fraction(win_T *wp, int prev_height) |
6875 { | 6879 { |