lewis6991 / impatient.nvim

Improve startup time for Neovim
MIT License
1.19k stars 28 forks source link

check-file-exists-in-print-profile #79

Closed jossephus closed 1 year ago

jossephus commented 1 year ago

I tried to run the command "LuaCacheProfile" and I was getting this error

Error executing Lua callback: ...share/nvim/lazy/impatient.nvim/lua/impatient/profile.lua:200: attempt to index a nil value                                    
stack traceback:
        ...share/nvim/lazy/impatient.nvim/lua/impatient/profile.lua:200: in function 'print_profile'
        ...share/nvim/lazy/impatient.nvim/lua/impatient/profile.lua:327: in function <...share/nvim/lazy/impatient.nvim/lua/impatient/profile.lua:326>

I didn't see much through the whole code, but the one causing this problem was accessing a file that doesn't exists. so this pull request checks if the file exists or not before accessing the "size" of the file.

I am making this pull request to bring the issue

lewis6991 commented 1 year ago

In nvim 0.9 you no longer need this plugin. Instead run vim.loader.enable().