patch 7.4.984
Problem: searchpos() always starts searching in the first column, which is
not what some people expect. (Brett Stahlman)
Solution: Add the 'z' flag: start at the specified column.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index f59c7f4..cb612ca 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 7.4. Last change: 2015 Dec 03
+*eval.txt* For Vim version 7.4. Last change: 2015 Dec 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5228,14 +5228,15 @@
move. No error message is given.
{flags} is a String, which can contain these character flags:
- 'b' search backward instead of forward
- 'c' accept a match at the cursor position
+ 'b' search Backward instead of forward
+ 'c' accept a match at the Cursor position
'e' move to the End of the match
'n' do Not move the cursor
- 'p' return number of matching sub-pattern (see below)
- 's' set the ' mark at the previous location of the cursor
- 'w' wrap around the end of the file
- 'W' don't wrap around the end of the file
+ 'p' return number of matching sub-Pattern (see below)
+ 's' Set the ' mark at the previous location of the cursor
+ 'w' Wrap around the end of the file
+ 'W' don't Wrap around the end of the file
+ 'z' start searching at the cursor column instead of zero
If neither 'w' or 'W' is given, the 'wrapscan' option applies.
If the 's' flag is supplied, the ' mark is set, only if the
@@ -5243,6 +5244,12 @@
flag.
'ignorecase', 'smartcase' and 'magic' are used.
+
+ When the 'z' flag is not given seaching always starts in
+ column zero and then matches before the cursor are skipped.
+ When the 'c' flag is present in 'cpo' the next search starts
+ after the match. Without the 'c' flag the next search starts
+ one column further.
When the {stopline} argument is given then the search stops
after searching this line. This is useful to restrict the