aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-01-25 08:52:40 -0800
committerGitHub <noreply@github.com>2021-01-25 17:52:40 +0100
commit1a6d89eb903d7b5a52e0638d0a53f0d697d34435 (patch)
treec6f6dbb0c1fef5bb1ad7481111e224ab40d09c9d
parent69103ff0cf9e23e4f003c9f22f482b3d52bf7892 (diff)
downloadrneovim-1a6d89eb903d7b5a52e0638d0a53f0d697d34435.tar.gz
rneovim-1a6d89eb903d7b5a52e0638d0a53f0d697d34435.tar.bz2
rneovim-1a6d89eb903d7b5a52e0638d0a53f0d697d34435.zip
lsp: match textDocument/didChange eol behavior (#13792)
We should be consistent in sending the EOL character to servers(I think). Julia expects this to match on bufwrite, or it crashes when vim appends the newline during the write process.
-rw-r--r--runtime/lua/vim/lsp.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 6229ee7359..a6f118abde 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -891,9 +891,7 @@ end
function lsp._text_document_did_save_handler(bufnr)
bufnr = resolve_bufnr(bufnr)
local uri = vim.uri_from_bufnr(bufnr)
- local text = once(function()
- return table.concat(nvim_buf_get_lines(bufnr, 0, -1, false), '\n')
- end)
+ local text = once(buf_get_full_text)
for_each_buffer_client(bufnr, function(client, _client_id)
if client.resolved_capabilities.text_document_save then
local included_text