feat(lua): add vim.spell (#16620)

This commit is contained in:
Lewis Russell
2021-12-25 19:36:56 +00:00
committed by GitHub
parent 2ae63161e8
commit e11a44aa22
5 changed files with 201 additions and 0 deletions

View File

@@ -707,6 +707,38 @@ vim.mpack.encode({obj}) *vim.mpack.encode*
vim.mpack.decode({str}) *vim.mpack.decode*
Decodes (or "unpacks") the msgpack-encoded {str} to a Lua object.
------------------------------------------------------------------------------
VIM.SPELL *lua-spell*
vim.spell.check({str}) *vim.spell.check()*
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: >
vim.spell.check("the quik brown fox")
-->
{
{'quik', 'bad', 4}
}
<
Parameters: ~
{str} String to spell check.
Return: ~
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.
------------------------------------------------------------------------------
VIM *lua-builtin*