diff options
author | Florian Fischer <florian.fl.fischer@fau.de> | 2020-08-28 13:16:06 +0200 |
---|---|---|
committer | Florian Fischer <florian.fl.fischer@fau.de> | 2020-08-28 13:16:06 +0200 |
commit | 85bfeb5b9f5dc8b9f0cd504282c4bd56afc14e99 (patch) | |
tree | 6dbe229a19ed74adc0e3da05386eabe44e8ee924 | |
parent | bf3badc73dc5d43df3aab9070cf9faef37b96326 (diff) | |
download | vis-spellcheck-85bfeb5b9f5dc8b9f0cd504282c4bd56afc14e99.tar.gz |
return early if we can't get the typos from our external spellchecker
-rw-r--r-- | spellcheck.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spellcheck.lua b/spellcheck.lua index 5b374c2..252fbf1 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -134,6 +134,9 @@ vis.events.subscribe(vis.events.WIN_HIGHLIGHT, function(win) typos = last_typos else typos = get_typos(viewport) or "" + if not typos then + return false + end end for typo, start, finish in typo_iter(viewport_text, typos, ignored) do @@ -166,6 +169,9 @@ local wrap_lex_func = function(old_lex_func) if last_data ~= data then typos = get_typos(data) + if not typos then + return tokens, timedout + end last_data = data else return old_new_tokens |