diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-12-28 19:20:36 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-12-28 19:20:36 +0100 |
commit | ad4d8a192abf44b89371af87d70b971cd654b799 (patch) | |
tree | ad7554b6a90c075cd2722259604c812842c22c7c /runtime | |
parent | a60824308cd9bc192c5d38fc16cccfcf652b40f6 (diff) |
patch 7.4.984v7.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.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index f59c7f4ebe..cb612caaaf 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 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()* 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 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()* 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 |