Skip to content

Commit 5834e2f

Browse files
committed
chore: nvim 0.10 api fixes
1 parent aa8b0b6 commit 5834e2f

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

lua/rest-nvim/curl/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ M.get_or_create_buf = function()
4040
local existing_bufnr = vim.fn.bufnr(tmp_name)
4141
if existing_bufnr ~= -1 then
4242
-- Set modifiable
43-
vim.api.nvim_set_option_value(existing_bufnr, "modifiable", true)
43+
vim.api.nvim_set_option_value("modifiable", true, { buf = existing_bufnr})
4444
-- Prevent modified flag
45-
vim.api.nvim_set_option_value(existing_bufnr, "buftype", "nofile")
45+
vim.api.nvim_set_option_value("buftype", "nofile", { buf = existing_bufnr})
4646
-- Delete buffer content
4747
vim.api.nvim_buf_set_lines(
4848
existing_bufnr,
@@ -59,7 +59,7 @@ M.get_or_create_buf = function()
5959
end
6060

6161
-- Create new buffer
62-
local new_bufnr = vim.api.nvim_create_buf(false, "nomodeline")
62+
local new_bufnr = vim.api.nvim_create_buf(false, true)
6363
vim.api.nvim_buf_set_name(new_bufnr, tmp_name)
6464
vim.api.nvim_set_option_value("ft", "httpResult", { buf = new_bufnr })
6565
vim.api.nvim_set_option_value("buftype", "nofile", { buf = new_bufnr })

lua/rest-nvim/request/init.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,7 @@ M.highlight = function(bufnr, start_line, end_line)
397397
higroup,
398398
{ start_line - 1, 0 },
399399
{ end_line - 1, end_column },
400-
"c",
401-
false
400+
{ regtype = "c"; inclusive = false }
402401
)
403402

404403
vim.defer_fn(function()

0 commit comments

Comments
 (0)