Rob Wu wrote: > The counted number of bytes is decreased if 'bin' and 'noeol' are set. > This is incorrect, and the logic should only apply when the requested > line is the last line in the buffer. > > Test cases: > vim -b <(printf '123\n567') +':echo line2byte(1)' > Expected: 1 > Actual : -1 > > vim -b <(printf '123\n567') +':echo line2byte(2)' > Expected: 5 > Actual : 4 > > vim -b <(printf '123\r\n678') +':echo line2byte(2)' > Expected: 6 > Actual : 5 > > vim -b <(printf '123\n567') +':echo line2byte(3)' > Expected: 9 > Actual : 8 > > vim -b <(printf '123\r\n678') +':echo line2byte(3)' > Expected: 10 (not 11, because in binary mode fileformat is ignored, > so pressing enter adds a LF and not a CR LF). > Actual : 9
Thanks for the patch. I notice there aren't any tests for line2byte(), perhaps someone can create them? -- hundred-and-one symptoms of being an internet addict: 212. Your Internet group window has more icons than your Accessories window. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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 --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
