aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-23 16:14:24 -0800
committerAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-23 16:14:24 -0800
commitd410812311f7b462420690455914ea1316953b3a (patch)
treefb313128e727a3a51c867a3d98e4228e6b237611 /runtime/lua/vim/lsp/util.lua
parent42c53d266afb989467879de29ef2e9ccdaa4b152 (diff)
downloadrneovim-d410812311f7b462420690455914ea1316953b3a.tar.gz
rneovim-d410812311f7b462420690455914ea1316953b3a.tar.bz2
rneovim-d410812311f7b462420690455914ea1316953b3a.zip
UI tweaks.
- Hide diagnostics on client exit - Stop insert on popup focus. - Hide popup on insertchar (for signature_help)
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index e2a8748a20..0c53494f02 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -104,7 +104,7 @@ function M.apply_text_edits(text_edits, bufnr)
local e = cleaned[i]
local A = {e.A[1] - start_line, e.A[2]}
local B = {e.B[1] - start_line, e.B[2]}
- M.set_lines(lines, A, B, e.lines)
+ lines = M.set_lines(lines, A, B, e.lines)
end
if set_eol and #lines[#lines] == 0 then
table.remove(lines)
@@ -340,7 +340,8 @@ function M.open_floating_preview(contents, filetype, opts)
end
api.nvim_buf_set_lines(floating_bufnr, 0, -1, true, contents)
api.nvim_buf_set_option(floating_bufnr, 'modifiable', false)
- api.nvim_command("autocmd CursorMoved,BufHidden <buffer> ++once lua pcall(vim.api.nvim_win_close, "..floating_winnr..", true)")
+ -- TODO make InsertCharPre disappearing optional?
+ api.nvim_command("autocmd CursorMoved,BufHidden,InsertCharPre <buffer> ++once lua pcall(vim.api.nvim_win_close, "..floating_winnr..", true)")
return floating_bufnr, floating_winnr
end