Comment #11 on issue 287 by [email protected]: Newline substitution
behaviour
https://code.google.com/p/vim/issues/detail?id=287
Vim 7.4 reported "<addresscount> substitutions on 1 line", vim 7.4.232
reports "<addresscount> substitutions on <addresscount> lines" Which I
personally think is correct, since this is the number of substitions
performed.
If by <addresscount> you mean the number of lines within the range,
please notice it's not always true that the number of substitutions is
equal to that. That's only true when range doesn't include last line.
Sure, but I was just mentioning the pre 7.4.232 patch behaviour. And
that was independent of whether there was a linebreak substituted in the
last line. In fact, it could have even been true, that previous Vim did
replace that linebreak and it would be recreated when writing that buffer.
Regarding the number of lines affected, I think what should be
considered correct depends on the intended meaning of the message. I
mean, whether it refers to lines as they were before the change, or
after it. I can only make sense of vim 7.4's behaviour if the "after"
interpretation is taken. On the other hand, I personally think the
"before" interpretation is more logical. And in that case, reported
lines should be equal to reported substitutions. So, I think message
meaning should be clarified to reach an agreement on this.
While that is true, ':%s/\n//' will report the number of substitutions
as the number of lines affected, while with slightly different patterns it
will report "on 1 line" (e.g. :%s/\(.\)\n/\1/) and this is even more
confusing. That's why I was resetting the sub_nlines counter to 1 in my
patch.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
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.