Loading ...
Sorry, an error occurred while loading the content.

Re: buffer size

Expand Messages
  • sc
    ... let sz = line( $ ) call Dowhateverwith(sz) -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you
    Message 1 of 4 , Aug 1, 2012
    • 0 Attachment
      On Tue, Jul 31, 2012 at 07:09:25PM +0200, rockybalboa4 wrote:
      > What ways are there to check the buffer size?
      >  
      > getfsize()
      >  
      >  
      > redir @"
      > execute "silent normal! g\<C-g>"
      > redir END
      >  
      >  
      > More?

      let sz = line('$')
      call Dowhateverwith(sz)

      --
      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
    • rockybalboa4
      ... line2byte(line( $ ) + 1) is good for my purposes - I am building different backup procedures for different buffer sizes - line( $ ) could be acceptable for
      Message 2 of 4 , Aug 2, 2012
      • 0 Attachment
        > > What ways are there to check the buffer size?
        > >
        > >  
        > >
        > > getfsize()
        > >
        > >  
        > >
        > >  
        > >
        > > redir @"
        > >
        > > execute "silent normal! g\<C-g>"
        > >
        > > redir END
        > >
        > >  
        > >
        > >  
        >
        > There's the line2byte() function as well. I assume you want size in bytes?


        line2byte(line('$') + 1) is good for my purposes - I am building different backup procedures for different buffer sizes - line('$') could be acceptable for this as well, but in general the result on the modified or unnamed buffer is better than checking a file on disk.
         
        Thanks
        rockybalboa4

        --
        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
      Your message has been successfully submitted and would be delivered to recipients shortly.