mirror of
https://github.com/neovim/neovim.git
synced 2026-01-05 02:47:28 +10:00
feat(ui): indicate margins for the area used by win_viewport
Problem: using win_viewport for implementing smooth scrolling in an external UI might run into problems when winbar or borders is used, as there is no indication that the entire grid is not used for scrolled buffer text. Solution: add `win_viewport_margins` event.
This commit is contained in:
@@ -1536,7 +1536,12 @@ describe('float window', function()
|
||||
}, win_viewport={
|
||||
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
||||
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
|
||||
}}
|
||||
},
|
||||
win_viewport_margins={
|
||||
[2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
|
||||
[4] = {win = 1001, top = 1, bottom = 1, left = 1, right = 1};
|
||||
}
|
||||
}
|
||||
else
|
||||
screen:expect{grid=[[
|
||||
^ |
|
||||
@@ -1736,7 +1741,12 @@ describe('float window', function()
|
||||
}, win_viewport={
|
||||
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
||||
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
|
||||
}}
|
||||
},
|
||||
win_viewport_margins={
|
||||
[2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
|
||||
[4] = {win = 1001, top = 0, bottom = 0, left = 1, right = 1};
|
||||
}
|
||||
}
|
||||
else
|
||||
screen:expect{grid=[[
|
||||
^ |
|
||||
@@ -1769,6 +1779,10 @@ describe('float window', function()
|
||||
}, win_viewport={
|
||||
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
||||
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
|
||||
},
|
||||
win_viewport_margins={
|
||||
[2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
|
||||
[4] = {win = 1001, top = 1, bottom = 1, left = 0, right = 0};
|
||||
}}
|
||||
else
|
||||
screen:expect{grid=[[
|
||||
@@ -1814,6 +1828,10 @@ describe('float window', function()
|
||||
}, win_viewport={
|
||||
[2] = {win = 1000, topline = 0, botline = 6, curline = 5, curcol = 0, linecount = 6, sum_scroll_delta = 0};
|
||||
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
|
||||
},
|
||||
win_viewport_margins={
|
||||
[2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
|
||||
[4] = {win = 1001, top = 0, bottom = 1, left = 0, right = 1};
|
||||
}}
|
||||
else
|
||||
screen:expect{grid=[[
|
||||
@@ -8361,6 +8379,10 @@ describe('float window', function()
|
||||
}, win_viewport={
|
||||
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
||||
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
||||
},
|
||||
win_viewport_margins={
|
||||
[2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
|
||||
[4] = {win = 1001, top = 2, bottom = 1, left = 1, right = 1};
|
||||
}}
|
||||
else
|
||||
screen:expect{grid=[[
|
||||
|
||||
Reference in New Issue
Block a user