@@ -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_buf_set_option (existing_bufnr , " modifiable" , true )
43+ vim .api .nvim_set_option_value (existing_bufnr , " modifiable" , true )
4444 -- Prevent modified flag
45- vim .api .nvim_buf_set_option (existing_bufnr , " buftype" , " nofile" )
45+ vim .api .nvim_set_option_value (existing_bufnr , " buftype" , " nofile" )
4646 -- Delete buffer content
4747 vim .api .nvim_buf_set_lines (
4848 existing_bufnr ,
@@ -53,16 +53,17 @@ M.get_or_create_buf = function()
5353 )
5454
5555 -- Make sure the filetype of the buffer is httpResult so it will be highlighted
56- vim .api .nvim_buf_set_option ( existing_bufnr , " ft" , " httpResult" )
56+ vim .api .nvim_set_option_value ( " ft" , " httpResult" , { buf = existing_bufnr } )
5757
5858 return existing_bufnr
5959 end
6060
6161 -- Create new buffer
6262 local new_bufnr = vim .api .nvim_create_buf (false , " nomodeline" )
6363 vim .api .nvim_buf_set_name (new_bufnr , tmp_name )
64- vim .api .nvim_buf_set_option (new_bufnr , " ft" , " httpResult" )
65- vim .api .nvim_buf_set_option (new_bufnr , " buftype" , " nofile" )
64+ vim .api .nvim_set_option_value (" ft" , " httpResult" , { buf = new_bufnr })
65+ vim .api .nvim_set_option_value (" buftype" , " nofile" , { buf = new_bufnr })
66+
6667
6768 return new_bufnr
6869end
@@ -194,7 +195,7 @@ local function create_callback(curl_cmd, method, url, script_str)
194195 end
195196 vim .cmd (cmd_split .. res_bufnr )
196197 -- Set unmodifiable state
197- vim .api .nvim_buf_set_option ( res_bufnr , " modifiable" , false )
198+ vim .api .nvim_set_option_value ( " modifiable" , false , { buf = res_bufnr } )
198199 end
199200
200201 -- Send cursor in response buffer to start
0 commit comments