diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-10-17 22:04:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 22:04:26 +0800 |
commit | 8ebf2345339a0b2a35dc3eea15770bd71a1ee7f5 (patch) | |
tree | 7a977e5685d2058dca7b3573423720bfe4807c10 | |
parent | 637ab296cba9e37e7374a8c076342487398605ee (diff) | |
parent | 14a84ec169ca8ca29a80237e82f2bb8e15a28365 (diff) | |
download | rneovim-8ebf2345339a0b2a35dc3eea15770bd71a1ee7f5.tar.gz rneovim-8ebf2345339a0b2a35dc3eea15770bd71a1ee7f5.tar.bz2 rneovim-8ebf2345339a0b2a35dc3eea15770bd71a1ee7f5.zip |
Merge pull request #20685 from luukvbaal/scroll
fix: 'scroll' is not set correctly for floats with 'splitkeep'
-rw-r--r-- | src/nvim/window.c | 3 | ||||
-rw-r--r-- | test/functional/ui/float_spec.lua | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 002d95ac2a..7c246191a5 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -6119,7 +6119,6 @@ void win_fix_scroll(int resize) invalidate_botline_win(wp); validate_botline(wp); } - win_comp_scroll(wp); wp->w_prev_height = wp->w_height; wp->w_prev_winrow = wp->w_winrow; } @@ -6292,7 +6291,6 @@ void scroll_to_fraction(win_T *wp, int prev_height) wp->w_prev_fraction_row = wp->w_wrow; } - win_comp_scroll(wp); redraw_later(wp, UPD_SOME_VALID); wp->w_redr_status = true; invalidate_botline_win(wp); @@ -6327,6 +6325,7 @@ void win_set_inner_size(win_T *wp, bool valid_cursor) } wp->w_skipcol = 0; wp->w_height_inner = height; + win_comp_scroll(wp); // There is no point in adjusting the scroll position when exiting. Some // values might be invalid. diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 1a9a13f7d4..9ef36cf5ae 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -430,6 +430,13 @@ describe('float window', function() assert_alive() end) + it("'scroll' is computed correctly when opening float with splitkeep=screen #20684", function() + meths.set_option('splitkeep', 'screen') + local float_opts = {relative = 'editor', row = 1, col = 1, width = 10, height = 10} + local float_win = meths.open_win(0, true, float_opts) + eq(5, meths.win_get_option(float_win, 'scroll')) + end) + describe('with only one tabpage,', function() local float_opts = {relative = 'editor', row = 1, col = 1, width = 1, height = 1} local old_buf, old_win |