Skip to content

Commit

Permalink
fix(lsp_code_actions): previewer when ff=dos (closes #1172)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed May 4, 2024
1 parent cb208cd commit bec242d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/fzf-lua/previewer/codeaction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ local function diff_text_edits(text_edits, bufnr, offset_encoding, diff_opts)
table.concat(orig_lines, eol) .. eol,
table.concat(new_lines, eol) .. eol,
diff_opts)
return utils.strsplit(vim.trim(diff), eol)
-- Windows: some LSPs use "\n" for EOL (e.g clangd)
-- remove both "\n" and "\r\n" (#1172)
return utils.strsplit(vim.trim(diff), "\r?\n")
end

-- based on `vim.lsp.util.apply_text_document_edit`
Expand Down

0 comments on commit bec242d

Please sign in to comment.