API: TRY_WRAP() for "abort-causing non-exception errors"

- Introduce TRY_WRAP() until we have an *architectural* solution.
  - TODO: bfredl idea: prepare error-handling at "top level" (nv_event).
- nvim_paste(): Revert luaeval() hack (see parent commit).
  - With TRY_WRAP() in nvim_put(), 'nomodifiable' error now correctly
    "bubbles up".
This commit is contained in:
Justin M. Keyes
2019-08-27 05:19:36 +02:00
parent 46aa254bf3
commit 3157baed83
3 changed files with 39 additions and 52 deletions

View File

@@ -411,7 +411,7 @@ describe('API', function()
end)
it("fails if 'nomodifiable'", function()
command('set nomodifiable')
expect_err([[Buffer is not 'modifiable']], request,
expect_err([[Vim:E21: Cannot make changes, 'modifiable' is off]], request,
'nvim_put', {'a','b'}, 'l', true, true)
end)
it('inserts text', function()