jaxbot / github-issues.vim

Github issue lookup in Vim
http://jaxbot.me/articles/github-issues-vim-plugin-5-7-2014
Other
406 stars 28 forks source link

Lazily populate/fetch data for omnicompletion (slow startup with COMMIT_EDITMSG) #106

Closed blueyed closed 10 years ago

blueyed commented 10 years ago

I have noticed that Vim takes a few seconds when editing a commit message, and tracked it down to python populateOmniComplete():

FUNCTIONS SORTED ON SELF TIME
count  total (s)   self (s)  function
    1   2.020418   2.006085  <SNR>84_setupOmni()

FUNCTION  <SNR>84_setupOmni()
Called 1 time
Total time:   2.020418
 Self time:   2.006085

count  total (s)   self (s)
    1   0.014620   0.000287   call ghissues#init()

    1              0.000007   setlocal omnifunc=githubissues#CompleteIssues

                              " empty array will store the menu items
    1              0.000003   let b:omni_options = []

    1              2.005774   python populateOmniComplete()

It would be nice if this would get done only when the completion is being triggered/requested, and not unconditionally.

jaxbot commented 10 years ago

If this were done when completion started, though, typing would suddenly lag for a second, which is also undesirable. If you can figure out a good way to implement this, I'm down for it, though

blueyed commented 10 years ago

typing would suddenly lag for a second

Only invoking the omni-completion would cause a lag, and there's no other option. (omni-completion might be invoked automatically with YouCompleteMe / neocomplcache / etc, but then it's still better to have it not happen on buffer loading already)

jaxbot commented 10 years ago

Right, but if I type Fix # and Vim suddenly lags for a second or two, I think that would be quite irritating. It is a problem either way, but I'm not sure this solution is really better...

It could be added as an option, though