jaxbot / browserlink.vim

Live browser editing for Vim
MIT License
711 stars 38 forks source link

Refactor functions into an autoload file #31

Closed ohle closed 9 years ago

ohle commented 9 years ago

Startup times before:

[...]
243.202  032.647  032.647: sourcing /home/clausseno/.vim/bundle/browserlink.vim/plugin/browserlink.vim
[...]
405.791  000.009: --- VIM STARTED ---

After:

[...]
189.846  012.244  012.244: sourcing /home/clausseno/.vim/bundle/browserlink.vim/autoload/browserlink.vim
189.958  012.560  000.316: sourcing /home/clausseno/.vim/bundle/browserlink.vim/plugin/browserlink.vim
[...]
346.354  000.005: --- VIM STARTED ---

(both times editing a new .html file)

jaxbot commented 9 years ago

Looks good! I'll review this after work today. Glad you included the startup times, too. But does the autoload load even if the user doesn't use Brolink that session?

ohle commented 9 years ago

It shouldn't. But you're right, my startup file says it does, although the times are already faster. That's because I overlooked setupHandlers(), which is always called from the plugin. Moving that back into the plugin, I get

193.512  000.200  000.200: sourcing /home/clausseno/.vim/bundle/browserlink.vim/plugin/browserlink.vim

Amendmend follows.

jaxbot commented 9 years ago

Looks good, thanks for putting this together! :+1: