mirror of
https://github.com/mfussenegger/nvim-jdtls
synced 2024-09-16 14:34:13 +02:00
Normalize source line endings when loading classfile contents
This commit is contained in:
parent
503a399e0d
commit
44403b2ef6
1 changed files with 3 additions and 1 deletions
|
@ -1190,7 +1190,9 @@ function M.open_classfile(fname)
|
|||
local function handler(err, result)
|
||||
assert(not err, vim.inspect(err))
|
||||
content = result
|
||||
api.nvim_buf_set_lines(buf, 0, -1, false, vim.split(result, "\n", { plain = true }))
|
||||
local normalized = string.gsub(result, '\r\n', '\n')
|
||||
local source_lines = vim.split(normalized, "\n", { plain = true })
|
||||
api.nvim_buf_set_lines(buf, 0, -1, false, source_lines)
|
||||
vim.bo[buf].modifiable = false
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue