From 1a6d89eb903d7b5a52e0638d0a53f0d697d34435 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Mon, 25 Jan 2021 08:52:40 -0800 Subject: 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. --- runtime/lua/vim/lsp.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'runtime/lua/vim') 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 -- cgit