Skip to content

Commit 7e7dcfc

Browse files
fix: neovim v0.10.1 compatibility (fix #408)
1 parent e51fff1 commit 7e7dcfc

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

lua/rest-nvim/context.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,20 @@ end
6565
---@param key string
6666
---@param value string
6767
function Context:set_global(key, value)
68-
vim.validate("key", key, "string")
69-
vim.validate("value", value, "string")
68+
vim.validate({
69+
key = { key, "string" },
70+
value = { value, "string" },
71+
})
7072
self.vars[key] = value
7173
end
7274

7375
---@param key string
7476
---@param value string
7577
function Context:set_local(key, value)
76-
vim.validate("key", key, "string")
77-
vim.validate("value", value, "string")
78+
vim.validate({
79+
key = { key, "string" },
80+
value = { value, "string" },
81+
})
7882
self.lv[key] = value
7983
end
8084

lua/rest-nvim/parser/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ end
186186
---@param ctx rest.Context
187187
---@param endline number zero-based line number
188188
function parser.eval_context(source, ctx, endline)
189-
vim.validate("source", source, "number")
189+
vim.validate({ source = { source, "number" } })
190190
local startline = ctx.linenr
191191
for ln = startline, endline do
192192
local start_node = vim.treesitter.get_node({ pos = { ln, 0 } })

0 commit comments

Comments
 (0)