From 0efbbaf5ee38af516bd2881db4da09f3aaaeffc4 Mon Sep 17 00:00:00 2001 From: edluffy Date: Mon, 29 Mar 2021 19:49:24 +0100 Subject: [PATCH] Fix - disable popup in 'nofile' buffer types --- lua/specs/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/specs/init.lua b/lua/specs/init.lua index bedf27a..3895a44 100644 --- a/lua/specs/init.lua +++ b/lua/specs/init.lua @@ -15,6 +15,9 @@ function M.on_cursor_moved() end function M.show_specs() + local buftype = vim.api.nvim_buf_get_option(0, 'buftype') + if buftype == 'nofile' then return end + local cursor_col = vim.fn.wincol()-1 local cursor_row = vim.fn.winline()-1 local bufh = vim.api.nvim_create_buf(false, true) @@ -29,8 +32,6 @@ function M.show_specs() vim.api.nvim_win_set_option(win_id, 'winhl', 'Normal:'.. opts.popup.winhl) vim.api.nvim_win_set_option(win_id, "winblend", opts.popup.blend) - - local cnt = 0 local config = vim.api.nvim_win_get_config(win_id) local timer = vim.loop.new_timer()