Hi
You don't need to use any plugin to test this.
If you want proof that foldexpr is used for autocomplete, try this:
let g:c = 0
function! Myfoldexpr()
let g:c = 1 + g:c
return '='
endfunction
Then make a file with 10 lines.
:set fdm=expr
:set foldexpr=Myfoldexpr()
:echo g:c
It will say 11.
zx
:echo g:c
it will say 22
Now edit a new line and press <C-X>L
:echo g:c
it now says 33 or 34
Now if you make a file with 100 lines in it, each with a single
character. press <C-X>L and have a look at the counter, it's up to
nearer 150.
Now the fun part.
Make your file 100 lines long, each with 10 characters in it.Start a new
line and <C-X>L then escape and look at the counter.
Mine's at 7,437 executions!
So if the foldexpr is non-trivial it's clearly going to slow things down
if it's being used for autocomplete. Yes you could try to optimise
Simpylfold (and php-folding, and ...) but the issue seems to be why does
foldexpr have anything to do wiith autocomplete? I can see that after
making a change the foldexpr needs to be re-done, but perhaps it's
trying to do this for every character that would have to be input for a
line match, instead of re-doing it as the result of adding the full
match in one go?
I'm out of my depths, but hopefully this simple example shows there's
something sub-optimal.
Thanks,
Rich
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.