updated for version 7.0124
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 3ad65d1..f17cf65 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.0aa. Last change: 2005 Aug 01
+*options.txt* For Vim version 7.0aa. Last change: 2005 Aug 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1607,7 +1607,15 @@
with the matching words. These matches should include the "a:base"
text. When there are no matches return an empty List.
+ When searching for matches takes some time call |complete_add()| to
+ add each match to the total list. These matches should then not
+ appear in the returned list! Call |complete_check()| now and then to
+ allow the user to press a key while still searching for matches. Stop
+ searching when it returns non-zero.
+
The function must not move the cursor!
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
An example that completes the names of the months: >
fun! CompleteMonths(findstart, col, base)
@@ -1632,6 +1640,32 @@
endfun
set completefunc=CompleteMonths
<
+ The same, but now pretending searching for matches is slow: >
+ fun! CompleteMonths(findstart, col, base)
+ if a:findstart
+ " locate the start of the word
+ let line = getline('.')
+ let start = a:col
+ while start > 0 && line[start - 1] =~ '\a'
+ let start -= 1
+ endwhile
+ return start
+ else
+ " find months matching with "a:base"
+ for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
+ if m =~ '^' . a:base
+ call complete_add(m)
+ endif
+ sleep 300m " simulate searching for next match
+ if complete_check()
+ break
+ endif
+ endfor
+ return []
+ endif
+ endfun
+ set completefunc=CompleteMonths
+<
*'confirm'* *'cf'* *'noconfirm'* *'nocf'*
'confirm' 'cf' boolean (default off)