Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit 52ccd7c

Browse files
committed
fix: set a buffer variable for lsp floating window(#223)
1 parent 443a6bd commit 52ccd7c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lua/completion/hover.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ local fancy_floating_markdown = function(contents, opts)
219219
winnr = api.nvim_open_win(bufnr, false, opt)
220220
end
221221
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, stripped)
222+
-- setup a variable for floating window, fix #223
223+
vim.api.nvim_buf_set_var(bufnr, "lsp_floating", true)
222224

223225
local cwin = vim.api.nvim_get_current_win()
224226
vim.api.nvim_set_current_win(winnr)

lua/completion/signature_help.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ M.autoOpenSignatureHelp = function()
4242
if vim.tbl_isempty(lines) then
4343
return
4444
end
45-
vim.lsp.util.focusable_preview(method, function()
45+
local bufnr, _ = vim.lsp.util.focusable_preview(method, function()
4646
-- TODO show popup when signatures is empty?
4747
lines = vim.lsp.util.trim_empty_lines(lines)
4848
return lines, vim.lsp.util.try_trim_markdown_code_blocks(lines)
4949
end)
50+
-- setup a variable for floating window, fix #223
51+
vim.api.nvim_buf_set_var(bufnr, "lsp_floating", true)
5052
end)
5153
end
5254
end

0 commit comments

Comments
 (0)