Hi dev,

I have written my own user defined complete function(written
completely in vim scripting only, no other lang's used). In complete
function, one part of code finds the line no of opening parenthesis of
a function.
I have used the below code to do that.

let line=1
while ( line != 0)
            let line = searchpair('(', '', ')', 'bW',
'synIDattr(synID(line("."), col("."), 1), "name") =~ "cComment"')
endwhile

The problem with the above code is searchpair function is very slow.
It takes 6-7 seconds to match the opening parenthesis (Note: opening
parenthesis not farther than 10-15 lines).

I posted in vim_use groups to find effective way of matching
parenthesis ( link :http://groups.google.co.in/group/vim_use/
browse_thread/thread/f44b76248fef00ce)

It was suggested that I use normal % command. Now time to find the
opening parenthesis is reduced to 0.1 sec. But the main problem here
is just before the popup of complete function shows up, screen
flickers a bit.  Sometimes the popup menu isn't showed or sometimes it
is showed at the wrong line other than the cursor. The behavior is
unpredictable. This is irritating me :(



First of all, why searchpair function is damn slow and normal %
command is faster.
And why screen flickers or cursor line is disturbed in complete
function? (as per help manual, the complete function is allowed to
move the cursor)
Can you please suggest what can be done here?

Thanks for your time and help.

Regards,
kkde



-- 
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

Raspunde prin e-mail lui