Skip to content

Commit

Permalink
fix: make the result buffer unmodifiable (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
yetone authored Aug 15, 2024
1 parent dba5107 commit d92d26b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/avante/sidebar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ local function update_result_buf_content(content)
vim.defer_fn(function()
api.nvim_set_option_value("modifiable", true, { buf = result_buf })
api.nvim_buf_set_lines(result_buf, 0, -1, false, vim.split(content, "\n"))
api.nvim_set_option_value("modifiable", false, { buf = result_buf })
api.nvim_set_option_value("filetype", "markdown", { buf = result_buf })
if result_win ~= -1 then
-- Move to the bottom
api.nvim_win_set_cursor(result_win, { api.nvim_buf_line_count(result_buf), 0 })
api.nvim_set_option_value("modifiable", false, { buf = result_buf })
api.nvim_set_current_win(current_win)
end
end, 0)
Expand Down

0 comments on commit d92d26b

Please sign in to comment.