fix(lua): show error message when failing to set variable (#25321)

This commit is contained in:
zeertzjq
2023-09-23 15:59:37 +08:00
committed by GitHub
parent c0a29931e2
commit 5331d5772f
3 changed files with 8 additions and 0 deletions

View File

@@ -1353,6 +1353,9 @@ describe('API', function()
-- Set readonly v: var.
eq('Key is read-only: count',
pcall_err(request, 'nvim_set_vvar', 'count', 42))
-- Set non-existent v: var.
eq('Dictionary is locked',
pcall_err(request, 'nvim_set_vvar', 'nosuchvar', 42))
-- Set writable v: var.
meths.set_vvar('errmsg', 'set by API')
eq('set by API', meths.get_vvar('errmsg'))