feat: Live previews (peek editor)

Disabled by default, but if this feature turns out to be useful and
stable, it will replace the old preview window.
This commit is contained in:
hedy
2023-11-28 20:50:08 +08:00
parent 20cb9ef8dc
commit 884486f3d0
6 changed files with 242 additions and 89 deletions

View File

@@ -24,8 +24,12 @@ local function setup_global_autocmd()
pattern = '*',
callback = function()
local s = M._get_sidebar()
local w = vim.api.nvim_get_current_win()
if s and s.preview then
s.preview:close()
-- Don't close preview when entering preview!
if not s.preview.win or s.preview.win ~= w then
s.preview:close()
end
end
end,
})