aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-09-07 21:55:49 +0200
committerMatěj Cepl <mcepl@cepl.eu>2024-02-17 22:24:06 +0100
commit0c2b1a68c4047f642e2c65089d87cd8bd48d5109 (patch)
tree6c41cd319f09d10b9cc808532e502e0ca1180f3d
parent0914016d89e3f12429eed41513c7d5ac37fd39be (diff)
downloadvis-spellcheck-0c2b1a68c4047f642e2c65089d87cd8bd48d5109.tar.gz
First attempt to start daemon.HEADspell_daemon
Fails on missing `vis` symbol as in `vis.win.file` ???
-rw-r--r--spellcheck.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/spellcheck.lua b/spellcheck.lua
index 0c3549d..53e052c 100644
--- a/spellcheck.lua
+++ b/spellcheck.lua
@@ -45,6 +45,18 @@ spellcheck.check_tokens = {
[vis.lexers.DEFAULT] = true,
}
+function spell_init()
+ if not vis.communicate then
+ vis:info('Spellcheck Error: spellchecking support requires vis communicate patch')
+ return {}
+ else
+ local cmd = spellcheck.list_cmd:format(spellcheck.get_lang())
+ spellcheck.fd = vis.communicate("spelldaemon", cmd .. " -a")
+ end
+end
+
+spell_init()
+
-- Return nil or a string of misspelled word in a specific file range or text
-- by calling the spellchecker's list command.
-- If given a range we will use vis:pipe to get our typos from the spellchecker.