Saturday, June 9, 2012

speed up looping through all buffers

Hello,

Some time ago, I had written the buffers_search_and_replace plugin
(http://www.vim.org/scripts/script.php?script_id=1817) and I now want
to optimize it.

A simplified version of the main part of the code looks like this:

while (l:buffer_number <= l:last_buffer_number)
exe 'b! '.l:buffer_number

normal! gg
while search(g:Bs_search,'',l:total_lines) > 0
" store results ...
endwhile
endwhile

What seems to take a lot of time (even on just 50 files) is the second
line (the buffer switch 'b!' command).
Any idea how I could improve the performance ?

Regards,
--
Alex

--
You received this message from the "vim_use" 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

No comments: