goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.73k stars 101 forks source link

perf(startup): just check first 2 lines #240

Closed MariaSolOs closed 10 months ago

MariaSolOs commented 10 months ago

Addresses the comment that @bew left in https://github.com/goolord/alpha-nvim/pull/239#discussion_r1312709288.

goolord commented 10 months ago

ty for your contribution! fwiw i don't think this would actually effect many people since https://github.com/goolord/alpha-nvim/pull/240/files#diff-ec96159a0e4ab00d2629897381414ffd88f8e88aa0b82e2f8ba6e24da2873239R573 this line would return before the nvim_buf_get_lines call, so the vast majority of the time nvim_buf_get_lines would be getting called on an empty buffer unless someone had a configuration that would open a file on startup

MariaSolOs commented 10 months ago

@goolord yep I agree that it might not do much, but it shouldn't harm either ;)