mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
fix(api): nvim_buf_get_offset in a new buffer with zero or one lines
fixes #24930
This commit is contained in:
@@ -1151,6 +1151,18 @@ describe('api/buf', function()
|
||||
eq(6, bufmeths.get_offset(1,1))
|
||||
command("bunload! 1")
|
||||
eq(-1, bufmeths.get_offset(1,1))
|
||||
eq(-1, bufmeths.get_offset(1,0))
|
||||
end)
|
||||
|
||||
it('works in empty buffer', function()
|
||||
eq(0, get_offset(0))
|
||||
eq(1, get_offset(1))
|
||||
end)
|
||||
|
||||
it('works in buffer with one line inserted', function()
|
||||
feed('itext')
|
||||
eq(0, get_offset(0))
|
||||
eq(5, get_offset(1))
|
||||
end)
|
||||
end)
|
||||
|
||||
|
Reference in New Issue
Block a user