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

buffer size

Expand Messages
  • rockybalboa4
    What ways are there to check the buffer size?   getfsize()     redir @ execute silent normal! g redir END     More? -- You received this message
    Message 1 of 4 , Jul 31, 2012
      What ways are there to check the buffer size?
       
      getfsize()
       
       
      redir @"
      execute "silent normal! g\<C-g>"
      redir END
       
       
      More?

      --
      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
    • Ben Fritz
      ... There s the line2byte() function as well. I assume you want size in bytes? -- You received this message from the vim_use maillist. Do not top-post! Type
      Message 2 of 4 , Jul 31, 2012
        On Tuesday, July 31, 2012 12:09:25 PM UTC-5, rockybalboa4 wrote:
        > 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?

        --
        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
      • 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 3 of 4 , Aug 1, 2012
          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 4 of 4 , Aug 2, 2012
            > > 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.