Sorry for sending to Bram's private mail address. Here's my original mail.
---------- Forwarded message ---------- From: Easwy Yang <[EMAIL PROTECTED]> Date: 2007-3-21 上午9:19 Subject: Re: BUG? line("'A") always returns line number in all the files To: Bram Moolenaar <[EMAIL PROTECTED]> Yes, it is! Sorry for the misinformation. BTW, there's a mistake in the document, about col() function, the line "To get the line number use |col()|." ^^^ should be "To get the line number use |line()|." 2007/3/20, Bram Moolenaar <[EMAIL PROTECTED]>:
Easwy Yang wrote: > Reproducible: Always > > Steps to reproduce: > 1. Place an uppercase mark A in file aa.c; > 2. use :echo line("'A"), it will display the correct line number; > 3. change to another file, execute :echo line("'A"), it will display the line > number too. > > Actual result: > See above. > > Expected result: > In a file other than the uppercase mark placed, line() should return 0, as > vim 6.3 behaved. This is actually documented. The idea is that you can use line("'A") to check if the mark 'A is set. To find out what buffer the mark refers to use the getpos() function. -- ARTHUR: Listen, old crone! Unless you tell us where we can buy a shrubbery, my friend and I will ... we will say "Ni!" CRONE: Do your worst! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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 ///