summaryrefslogtreecommitdiffstats
path: root/runtime/doc/insert.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-07 20:27:04 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-07 20:27:04 +0000
commit113cb513f76d8866cbb6dc85fa18aded753e01da (patch)
tree991e2a39e12fe20709be583772ec8038ff3134e5 /runtime/doc/insert.txt
parent15d9890eee53afc61eb0a03b878a19cb5672f732 (diff)
Update runtime files
Diffstat (limited to 'runtime/doc/insert.txt')
-rw-r--r--runtime/doc/insert.txt46
1 files changed, 21 insertions, 25 deletions
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 7d218930d9..230afb1ed3 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt* For Vim version 8.2. Last change: 2021 Oct 18
+*insert.txt* For Vim version 8.2. Last change: 2021 Oct 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -871,31 +871,27 @@ invoked and what it should return.
Here is an example that uses the "aiksaurus" command (provided by Magnus
Groß): >
- func Thesaur(findstart, base)
- if a:findstart
- let line = getline('.')
- let start = col('.') - 1
- while start > 0 && line[start - 1] =~ '\a'
- let start -= 1
- endwhile
- return start
- else
- let res = []
- let h = ''
- for l in split(system('aiksaurus '.shellescape(a:base)), '\n')
- if l[:3] == '=== '
- let h = substitute(l[4:], ' =*$', '', '')
- elseif l[0] =~ '\a'
- call extend(res, map(split(l, ', '), {_, val -> {'word': val, 'menu': '('.h.')'}}))
- endif
- endfor
- return res
- endif
- endfunc
-
- if exists('+thesaurusfunc')
- set thesaurusfunc=Thesaur
+ func Thesaur(findstart, base)
+ if a:findstart
+ return searchpos('\<', 'bnW', line('.'))[1] - 1
+ endif
+ let res = []
+ let h = ''
+ for l in systemlist('aiksaurus '.shellescape(a:base))
+ if l[:3] == '=== '
+ let h = '('.substitute(l[4:], ' =*$', ')', '')
+ elseif l ==# 'Alphabetically similar known words are: '
+ let h = "\U0001f52e"
+ elseif l[0] =~ '\a' || (h ==# "\U0001f52e" && l[0] ==# "\t")
+ call extend(res, map(split(substitute(l, '^\t', '', ''), ', '), {_, val -> {'word': val, 'menu': h}}))
endif
+ endfor
+ return res
+ endfunc
+
+ if exists('+thesaurusfunc')
+ set thesaurusfunc=Thesaur
+ endif
Completing keywords in the current and included files *compl-keyword*