Skip to content

Commit

Permalink
feat: make diff mode more readable. (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
you-n-g authored Dec 13, 2023
1 parent 800f24c commit f189c51
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/chatgpt/code_edits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,12 @@ M.edit_with_instructions = function(output_lines, bufnr, selection, ...)
for _, winid in ipairs({ input_window.winid, output_window.winid }) do
vim.api.nvim_set_current_win(winid)
if diff_mode then
-- set local wrap to be previous option to make it mroe readable(wrap=true is often more readable in diff mode).
local previous_wrap = vim.o.wrap
vim.api.nvim_command("diffthis")
if vim.o.wrap ~= previous_wrap then
vim.o.wrap = previous_wrap
end
else
vim.api.nvim_command("diffoff")
end
Expand Down

0 comments on commit f189c51

Please sign in to comment.