mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
tests: add test for Scroll autocmd
This commit is contained in:
24
test/functional/autocmd/scroll_spec.lua
Normal file
24
test/functional/autocmd/scroll_spec.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
|
|
||||||
|
local clear = helpers.clear
|
||||||
|
local eq = helpers.eq
|
||||||
|
local eval = helpers.eval
|
||||||
|
local funcs = helpers.funcs
|
||||||
|
local source = helpers.source
|
||||||
|
|
||||||
|
describe('Scroll', function()
|
||||||
|
before_each(clear)
|
||||||
|
|
||||||
|
it('is triggered by scrolling the window', function()
|
||||||
|
source([[
|
||||||
|
let g:scroll = 0
|
||||||
|
let g:buf = bufnr('%')
|
||||||
|
|
||||||
|
autocmd scroll * let g:scroll += 1
|
||||||
|
|
||||||
|
call nvim_buf_set_lines(g:buf, 0, -1, v:true, ['1', '2', '3', '4', '5'])
|
||||||
|
call feedkeys("\<C-e>", "n")
|
||||||
|
]])
|
||||||
|
eq(1, eval('g:scroll'))
|
||||||
|
end)
|
||||||
|
end)
|
Reference in New Issue
Block a user