Skip to content

Commit

Permalink
fix(codeaction preview): create file action diff
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Feb 23, 2024
1 parent 3e481c9 commit 3b3cc17
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/fzf-lua/previewer/codeaction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ local function diff_workspace_edit(workspace_edit, offset_encoding, diff_opts)
local path = vim.fn.fnamemodify(vim.uri_to_fname(change.uri), ":.")

table.insert(diff, string.format("diff --code-actions a/%s b/%s", path, path))
table.insert(diff, "new file")
-- delta needs file mode
table.insert(diff, "new file mode 100644")
-- diff-so-fancy needs index
table.insert(diff, "index 0000000..fffffff")
table.insert(diff, "")
elseif change.kind == "delete" then
local path = vim.fn.fnamemodify(vim.uri_to_fname(change.uri), ":.")
Expand Down

0 comments on commit 3b3cc17

Please sign in to comment.