0

this is my code that print hello world

that print hello world

now if i use command Format that call vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]

my code will becames like this now strange symbols appear in the text

now strange symbols appear in the text

clangd changes my text with ^M symbol

neovim version:0.6.1

this is a part of my lsp-installer configuration file:

lsp_installer.on_server_ready(function(server)
local opts = {
    on_attach = require("config.lsp.handlers").on_attach,
    capabilities = require("config.lsp.handlers").capabilities,
}

-- Lua
if server.name == "sumneko_lua" then
    local sumneko_opts = require("config.lsp.settings.sumneko_lua")
    opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
end

-- Python
if server.name == "pyright" then
    local pyright_opts = require("config.lsp.settings.pyright")
    opts = vim.tbl_deep_extend("force", pyright_opts, opts)
end

-- C/C++
-- if server.name == "clangd" then
--
-- end


-- This setup() function is exactly the same as lspconfig's setup function.
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
server:setup(opts)

end)

HighCommander4
  • 50,428
  • 24
  • 122
  • 194
  • 1
    Add all relevant info: platform, nvim version, minimal config to reproduce. Otherwise, this question is too vague. – jdhao Feb 28 '22 at 02:50
  • The `^M` characters are Windows line endings, and the fact that clangd is adding them is probably a sign of mis-configuration somewhere, though I'm not sure where. – HighCommander4 Jul 12 '22 at 00:49

0 Answers0