Skip to content

Commit a5ffbd0

Browse files
author
jghauser
committed
fix: only start papis.nvim once
1 parent 2012f1d commit a5ffbd0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lua/papis/init.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@
77

88
local config = require("papis.config")
99
local api = vim.api
10+
local has_run = false
1011

1112
---Creates the `autocmd` that starts papis.nvim when configured conditions are fulfilled
1213
local function make_start_autocmd()
1314
local load_papis = api.nvim_create_augroup("loadPapis", { clear = true })
1415
api.nvim_create_autocmd("FileType", {
1516
once = true,
1617
pattern = config.init_filetypes,
17-
callback = require("papis").start,
18+
callback = function()
19+
if not has_run then
20+
require("papis").start()
21+
end
22+
end,
1823
group = load_papis,
1924
desc = "Load papis.nvim for defined filetypes",
2025
})
@@ -52,6 +57,8 @@ function M.start()
5257
log.new(config["log"] or log.get_default_config(), true)
5358
log.debug("_________________________STARTING PAPIS.NVIM_________________________")
5459

60+
has_run = true
61+
5562
-- set up db
5663
local db = require("papis.sqlite-wrapper")
5764
if not db then

0 commit comments

Comments
 (0)