Skip to content

Commit

Permalink
fix: load plugin/ in autocmds before 'loadplugins'
Browse files Browse the repository at this point in the history
Fix #33
  • Loading branch information
lewis6991 committed Dec 3, 2024
1 parent 71cb31a commit 51fc627
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/pckr/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ local function packadd(plugin, bang)
return
end

if vim.v.vim_did_enter == 0 and bang then
-- Use vim.g.loaded_pckr as a signal for then plugin/* is loaded.
if not vim.g.loaded_pckr and bang then
-- Do not source. We've already added to rtp, so no need to do anything.
-- Do not load plugin/* as that will be done by 'loadplugins' later.
return
end

Expand Down
5 changes: 5 additions & 0 deletions plugin/pckr.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
if not vim.g.loaded_pckr then
return
end

vim.g.loaded_pckr = true

vim.api.nvim_create_user_command(
'Pckr',
Expand Down

0 comments on commit 51fc627

Please sign in to comment.