neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 8ebf2345339a0b2a35dc3eea15770bd71a1ee7f5
parent 637ab296cba9e37e7374a8c076342487398605ee
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Mon, 17 Oct 2022 22:04:26 +0800

Merge pull request #20685 from luukvbaal/scroll

fix: 'scroll' is not set correctly for floats with 'splitkeep'
Diffstat:
Msrc/nvim/window.c | 3+--
Mtest/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 @@ -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 @@ -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