Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
validate the window
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed May 1, 2024
1 parent b9f43fd commit f2ceade
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/epo/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ local function close_popup_win(winid)
end

local function popup_markdown_set(wininfo)
if vim.tbl_isempty(wininfo) or (wininfo.winid and not api.nvim_win_is_valid(wininfo.winid)) then
if vim.tbl_isempty(wininfo) then
return
end
local ok, _ = pcall(api.nvim_win_is_valid, wininfo.winid)
if not ok then
return
end
ok, _ = pcall(api.nvim_buf_is_valid, wininfo.bufnr)
if not ok then
return
end
vim.wo[wininfo.winid].conceallevel = 2
Expand Down

0 comments on commit f2ceade

Please sign in to comment.