Friday, April 8, 2016

Documentation of the z flag in search()

I am trying to understand how the z flag affects search(). From the manual:

'z' start searching at the cursor column instead of zero

and a bit further:

When the 'z' flag is not given, searching always starts in
column zero and then matches before the cursor are skipped.

It seems to me that this latter sentence makes sense only for backward
searches. Even in that case, consider this text:

abc x

Assuming the cursor is on x, the following:

echo search('abc', 'bW')

returns 1, while

echo search('abc', 'bWz')

returns 0. Given the description above, I would expect the opposite. Am I
missing something?

Nicola


--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment