Skip to content

Commit

Permalink
Updating so error filetype can be used in edit
Browse files Browse the repository at this point in the history
  • Loading branch information
huynle committed Jan 25, 2024
1 parent 2bd9c98 commit 0419dd1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/ogpt/edits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ local build_edit_messages = function(input, instructions, opts)
local _input = input
if opts.edit_code then
_input = "```" .. (opts.filetype or "") .. "\n" .. input .. "````"
else
_input = "```" .. (opts.filetype or "") .. "\n" .. input .. "````"
end
local variables = vim.tbl_extend("force", {}, {
instruction = instructions,
Expand Down Expand Up @@ -126,7 +128,7 @@ local setup_and_mount = vim.schedule_wrap(function(lines, output_lines, ...)

-- set input and output settings
for _, window in ipairs({ input_window, output_window }) do
vim.api.nvim_buf_set_option(window.bufnr, "filetype", filetype)
vim.api.nvim_buf_set_option(window.bufnr, "filetype", "markdown")
vim.api.nvim_win_set_option(window.winid, "number", true)
end
end)
Expand Down

0 comments on commit 0419dd1

Please sign in to comment.