aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta/spell.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-07-17 17:40:14 +0100
committerGitHub <noreply@github.com>2023-07-17 17:40:14 +0100
commit80cf0f3d29fa337d43ec417759cb061bd2798ea8 (patch)
tree16de8180f2fb9feefd0df94e0c8598475ec28324 /runtime/lua/vim/_meta/spell.lua
parent1b9ccd38a12f8fdbdff51ef0b3ff363540f745ec (diff)
parent6e9b204afbe5f16c44a2697aed07aafff36bf856 (diff)
downloadrneovim-80cf0f3d29fa337d43ec417759cb061bd2798ea8.tar.gz
rneovim-80cf0f3d29fa337d43ec417759cb061bd2798ea8.tar.bz2
rneovim-80cf0f3d29fa337d43ec417759cb061bd2798ea8.zip
Merge pull request #24363 from lewis6991/docs/luatypes
docs(lua): move some function docs to lua files
Diffstat (limited to 'runtime/lua/vim/_meta/spell.lua')
-rw-r--r--runtime/lua/vim/_meta/spell.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/runtime/lua/vim/_meta/spell.lua b/runtime/lua/vim/_meta/spell.lua
new file mode 100644
index 0000000000..d55867f769
--- /dev/null
+++ b/runtime/lua/vim/_meta/spell.lua
@@ -0,0 +1,31 @@
+--- @meta
+
+-- luacheck: no unused args
+
+--- Check {str} for spelling errors. Similar to the Vimscript function
+--- |spellbadword()|.
+---
+--- Note: The behaviour of this function is dependent on: 'spelllang',
+--- 'spellfile', 'spellcapcheck' and 'spelloptions' which can all be local to
+--- the buffer. Consider calling this with |nvim_buf_call()|.
+---
+--- Example:
+--- <pre>lua
+--- vim.spell.check("the quik brown fox")
+--- -- =>
+--- -- {
+--- -- {'quik', 'bad', 5}
+--- -- }
+--- </pre>
+---
+--- @param str string
+--- @return {[1]: string, [2]: string, [3]: string}[]
+--- List of tuples with three items:
+--- - The badly spelled word.
+--- - The type of the spelling error:
+--- "bad" spelling mistake
+--- "rare" rare word
+--- "local" word only valid in another region
+--- "caps" word should start with Capital
+--- - The position in {str} where the word begins.
+function vim.spell.check(str) end