Small nvim fixes

This commit is contained in:
Barak Michener 2022-06-08 15:14:06 -07:00
parent 1e5bd3255d
commit 14c50758fb
2 changed files with 2 additions and 2 deletions

View file

@ -65,7 +65,7 @@ function org_imports(wait_ms)
for _, res in pairs(result or {}) do
for _, r in pairs(res.result or {}) do
if r.edit then
vim.lsp.util.apply_workspace_edit(r.edit)
vim.lsp.util.apply_workspace_edit(r.edit, "utf-8")
else
vim.lsp.buf.execute_command(r.command)
end

2
.vimrc
View file

@ -294,7 +294,7 @@ autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 1000)
autocmd BufWritePre *.py lua vim.lsp.buf.formatting_sync(nil, 1000)
autocmd BufWritePre *.rs lua vim.lsp.buf.formatting_seq_sync(nil, 1000)
autocmd BufWritePre *.go lua vim.lsp.buf.formatting_seq_sync(nil, 1000)
autocmd BufWritePre *.go :silent! lua org_imports(3000)
autocmd BufWritePre *.go silent! lua org_imports(3000)
" Goto previous/next diagnostic warning/error
nnoremap <silent> g[ <cmd>lua vim.diagnostic.goto_prev()<CR>