Skip to content

Commit 64aa0f7

Browse files
authored
fix(move): check for filler lines properly (neovim#28307)
vim-patch:9.1.0310: Filler lines not checked properly in get_scroll_overlap()
1 parent 2c5fd3f commit 64aa0f7

File tree

2 files changed

+83
-1
lines changed

2 files changed

+83
-1
lines changed

src/nvim/move.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ static int get_scroll_overlap(Direction dir)
23622362
}
23632363

23642364
loff.lnum = dir == FORWARD ? curwin->w_botline : curwin->w_topline - 1;
2365-
loff.fill = win_get_fill(curwin, loff.lnum + dir == BACKWARD)
2365+
loff.fill = win_get_fill(curwin, loff.lnum + (dir == BACKWARD))
23662366
- (dir == FORWARD ? curwin->w_filler_rows : curwin->w_topfill);
23672367
loff.height = loff.fill > 0 ? 1 : plines_win_nofill(curwin, loff.lnum, true);
23682368

test/functional/ui/decorations_spec.lua

+82
Original file line numberDiff line numberDiff line change
@@ -4894,6 +4894,88 @@ if (h->n_buckets < new_n_buckets) { // expand
48944894
|
48954895
]])
48964896
end)
4897+
4898+
it('works with full page scrolling #28390', function()
4899+
screen:try_resize(20, 8)
4900+
command('call setline(1, range(20))')
4901+
api.nvim_buf_set_extmark(0, ns, 10, 0, { virt_lines = {{{'VIRT1'}}, {{'VIRT2'}}} })
4902+
screen:expect([[
4903+
^0 |
4904+
1 |
4905+
2 |
4906+
3 |
4907+
4 |
4908+
5 |
4909+
6 |
4910+
|
4911+
]])
4912+
feed('<C-F>')
4913+
screen:expect([[
4914+
^5 |
4915+
6 |
4916+
7 |
4917+
8 |
4918+
9 |
4919+
10 |
4920+
VIRT1 |
4921+
|
4922+
]])
4923+
feed('<C-F>')
4924+
screen:expect([[
4925+
^10 |
4926+
VIRT1 |
4927+
VIRT2 |
4928+
11 |
4929+
12 |
4930+
13 |
4931+
14 |
4932+
|
4933+
]])
4934+
feed('<C-F>')
4935+
screen:expect([[
4936+
^13 |
4937+
14 |
4938+
15 |
4939+
16 |
4940+
17 |
4941+
18 |
4942+
19 |
4943+
|
4944+
]])
4945+
feed('<C-B>')
4946+
screen:expect([[
4947+
10 |
4948+
VIRT1 |
4949+
VIRT2 |
4950+
11 |
4951+
12 |
4952+
^13 |
4953+
14 |
4954+
|
4955+
]])
4956+
feed('<C-B>')
4957+
screen:expect([[
4958+
5 |
4959+
6 |
4960+
7 |
4961+
8 |
4962+
9 |
4963+
^10 |
4964+
VIRT1 |
4965+
|
4966+
]])
4967+
feed('<C-B>')
4968+
screen:expect([[
4969+
0 |
4970+
1 |
4971+
2 |
4972+
3 |
4973+
4 |
4974+
5 |
4975+
^6 |
4976+
|
4977+
]])
4978+
end)
48974979
end)
48984980

48994981
describe('decorations: signs', function()

0 commit comments

Comments
 (0)