mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
paste: handle 'nomodifiable'
- nvim_paste(): Marshal through luaeval() instead of nvim_execute_lua() because the latter seems to hide some errors. - Handle 'nomodifiable' in `nvim_put()` explicitly. - Require explicit `false` from `vim.paste()` in order to "cancel", otherwise assume true ("continue").
This commit is contained in:
@@ -409,6 +409,11 @@ describe('API', function()
|
||||
expect_err("Invalid type: 'x'", request,
|
||||
'nvim_put', {'foo'}, 'x', false, false)
|
||||
end)
|
||||
it("fails if 'nomodifiable'", function()
|
||||
command('set nomodifiable')
|
||||
expect_err([[Buffer is not 'modifiable']], request,
|
||||
'nvim_put', {'a','b'}, 'l', true, true)
|
||||
end)
|
||||
it('inserts text', function()
|
||||
-- linewise
|
||||
nvim('put', {'line 1','line 2','line 3'}, 'l', true, true)
|
||||
|
Reference in New Issue
Block a user