Brad Beveridge wrote:

> The last code I posted was a little broken.  Here is a patch that
> appears (after a reasonable amount of testing) to work quite well for
> very quickly appending chars to a vim line.
> As I said, scripting language authors that use Vim output buffers as
> STDOUT style streams could use this to good advantage.

Thanks for making this patch.

I wonder how you create a new line.  Using the old mechanism you mostly
end up reallocating the line at the next insert.  Allocating a bit of
room to anticipate further appends would be more efficient.

Also, for appending to a different line than before you copy the line
twice.  You can avoid that by using vim_strnsave() instead of
vim_strsave() and reserving space for new characters right away.

-- 
hundred-and-one symptoms of being an internet addict:
192. Your boss asks you to "go fer" coffee and you come up with 235 FTP sites.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to