Skip to content

Commit 67f86bc

Browse files
authored
prevent modified flag switch for httpResult (#34)
1 parent 5d555f0 commit 67f86bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/rest-nvim/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ local function get_or_create_buf()
2121
if existing_bufnr ~= -1 then
2222
-- Set modifiable
2323
vim.api.nvim_buf_set_option(existing_bufnr, 'modifiable', true)
24+
-- Prevent modified flag
25+
vim.api.nvim_buf_set_option(existing_bufnr, 'buftype', 'nofile')
2426
-- Delete buffer content
2527
vim.api.nvim_buf_set_lines(
2628
existing_bufnr,
@@ -40,6 +42,7 @@ local function get_or_create_buf()
4042
local new_bufnr = vim.api.nvim_create_buf(false, 'nomodeline')
4143
vim.api.nvim_buf_set_name(new_bufnr, tmp_name)
4244
vim.api.nvim_buf_set_option(new_bufnr, 'ft', 'httpResult')
45+
vim.api.nvim_buf_set_option(new_bufnr, 'buftype', 'nofile')
4346

4447
return new_bufnr
4548
end

0 commit comments

Comments
 (0)