diff options
Diffstat (limited to 'lua/conform')
-rw-r--r-- | lua/conform/health.lua | 2 | ||||
-rw-r--r-- | lua/conform/lsp_format.lua | 2 | ||||
-rw-r--r-- | lua/conform/runner.lua | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lua/conform/health.lua b/lua/conform/health.lua index 61cdc6f..c02fd00 100644 --- a/lua/conform/health.lua +++ b/lua/conform/health.lua @@ -95,7 +95,7 @@ M.show_window = function() f:seek("end", context) local text = f:read("*a") f:close() - local log_lines = vim.split(text, "\n", { plain = true, trimempty = true }) + local log_lines = vim.split(text, "\r?\n", { trimempty = true }) for i = 2, #log_lines do table.insert(lines, string.rep(" ", 10) .. log_lines[i]) end diff --git a/lua/conform/lsp_format.lua b/lua/conform/lsp_format.lua index f49e15f..6fa9a64 100644 --- a/lua/conform/lsp_format.lua +++ b/lua/conform/lsp_format.lua @@ -13,7 +13,7 @@ local function apply_text_edits(text_edits, bufnr, offset_encoding, dry_run) and text_edits[1].range["end"].character == 0 then local original_lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, true) - local new_lines = vim.split(text_edits[1].newText, "\n", { plain = true }) + local new_lines = vim.split(text_edits[1].newText, "\r?\n", {}) -- If it had a trailing newline, remove it to make the lines match the expected vim format if #new_lines > 1 and new_lines[#new_lines] == "" then table.remove(new_lines) diff --git a/lua/conform/runner.lua b/lua/conform/runner.lua index 3d9df8b..725e824 100644 --- a/lua/conform/runner.lua +++ b/lua/conform/runner.lua @@ -341,7 +341,7 @@ local function run_formatter(bufnr, formatter, config, ctx, input_lines, opts, c local stat = assert(uv.fs_fstat(fd)) local content = assert(uv.fs_read(fd, stat.size)) uv.fs_close(fd) - output = vim.split(content, "\n", { plain = true }) + output = vim.split(content, "\r?\n", {}) else output = stdout end |