-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: lazy load by ft will run function twice #228
Comments
That is correct. This is needed for some plugins that depend on the |
lazy.setup({
{
'nvim-lspconfig',
dev = true,
ft = { 'lua' },
config = function()
sumneko lua config here
})
end,
},
``
open lua file `FileType` will run twice. that mean the start client function run twice. |
although I can add a patch in nvim-lspconfig. but a little wired. what do you think about this behavior? |
I didn't read your comment well. it shouldn't fire twice I think. I'm looking into it to see what's causing that |
Should be fixed now! |
hmm did you test that. the lazy.setup({
{
'plugin-name',
dev = true,
ft = { 'lua' },
config = function()
vim.api.nvim_create_autocmd('FileType',{
pattern = 'lua',
callback = function()
print('hello')
end
})
end,
},
|
nvm. looks like works fine. |
looks like this is broken ? I don't get this work after i upgrade . still use before code snippets . open a lua file hello not printed. {
'plugin-name',
dev = true,
ft = { 'lua' },
config = function()
vim.api.nvim_create_autocmd('FileType',{
pattern = 'lua',
callback = function()
print('hello')
end
})
end,
}, |
Oh autocmd pr of ii14 has been merged .so maybe related. |
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.9.0-dev-576+g05b6dd6e5-dirty
Operating system/version
Macos 13.0.1
Describe the bug
if the plugin has
FileType
event and the plugin lazyload by ft , the event callback will run twice.Steps To Reproduce
Expected Behavior
print hello once.
Repro
The text was updated successfully, but these errors were encountered: