mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: 'smoothscroll' works with virt_lines above and below
This commit is contained in:
parent
35ed79a915
commit
f78130b2d8
@ -49,6 +49,9 @@ iterators |luaref-in|.
|
|||||||
• Added |vim.treesitter.query.omnifunc()| for treesitter query files (set by
|
• Added |vim.treesitter.query.omnifunc()| for treesitter query files (set by
|
||||||
default).
|
default).
|
||||||
|
|
||||||
|
• |'smoothscroll'| option to scroll by screen line rather than by text line
|
||||||
|
when |'wrap'| is set.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
CHANGED FEATURES *news-changed*
|
CHANGED FEATURES *news-changed*
|
||||||
|
|
||||||
|
@ -646,4 +646,77 @@ describe('smoothscroll', function()
|
|||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("works with virt_lines above and below", function()
|
||||||
|
screen:try_resize(55, 7)
|
||||||
|
exec([=[
|
||||||
|
call setline(1, ['Line' .. (' with some text'->repeat(7))]->repeat(3))
|
||||||
|
set smoothscroll
|
||||||
|
let ns = nvim_create_namespace('')
|
||||||
|
call nvim_buf_set_extmark(0, ns, 0, 0, {'virt_lines':[[['virt_below1']]]})
|
||||||
|
call nvim_buf_set_extmark(0, ns, 1, 0, {'virt_lines':[[['virt_above1']]],'virt_lines_above':1})
|
||||||
|
call nvim_buf_set_extmark(0, ns, 1, 0, {'virt_lines':[[['virt_below2']]]})
|
||||||
|
call nvim_buf_set_extmark(0, ns, 2, 0, {'virt_lines':[[['virt_above2']]],'virt_lines_above':1})
|
||||||
|
norm ggL
|
||||||
|
]=])
|
||||||
|
screen:expect([[
|
||||||
|
Line with some text with some text with some text with |
|
||||||
|
some text with some text with some text with some text |
|
||||||
|
virt_below1 |
|
||||||
|
virt_above1 |
|
||||||
|
^Line with some text with some text with some text with |
|
||||||
|
some text with some text with some text with some text |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed('<C-E>')
|
||||||
|
screen:expect([[
|
||||||
|
<<<e text with some text with some text with some text |
|
||||||
|
virt_below1 |
|
||||||
|
virt_above1 |
|
||||||
|
^Line with some text with some text with some text with |
|
||||||
|
some text with some text with some text with some text |
|
||||||
|
virt_below2 |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed('<C-E>')
|
||||||
|
screen:expect([[
|
||||||
|
virt_below1 |
|
||||||
|
virt_above1 |
|
||||||
|
^Line with some text with some text with some text with |
|
||||||
|
some text with some text with some text with some text |
|
||||||
|
virt_below2 |
|
||||||
|
virt_above2 |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed('<C-E>')
|
||||||
|
screen:expect([[
|
||||||
|
virt_above1 |
|
||||||
|
^Line with some text with some text with some text with |
|
||||||
|
some text with some text with some text with some text |
|
||||||
|
virt_below2 |
|
||||||
|
virt_above2 |
|
||||||
|
Line with some text with some text with some text wi@@@|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed('<C-E>')
|
||||||
|
screen:expect([[
|
||||||
|
^Line with some text with some text with some text with |
|
||||||
|
some text with some text with some text with some text |
|
||||||
|
virt_below2 |
|
||||||
|
virt_above2 |
|
||||||
|
Line with some text with some text with some text with |
|
||||||
|
some text with some text with some text with some text |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed('<C-E>')
|
||||||
|
screen:expect([[
|
||||||
|
<<<e text with some text with some text with some tex^t |
|
||||||
|
virt_below2 |
|
||||||
|
virt_above2 |
|
||||||
|
Line with some text with some text with some text with |
|
||||||
|
some text with some text with some text with some text |
|
||||||
|
~ |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user