From 85bfeb5b9f5dc8b9f0cd504282c4bd56afc14e99 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 28 Aug 2020 13:16:06 +0200 Subject: return early if we can't get the typos from our external spellchecker --- spellcheck.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spellcheck.lua') 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 -- cgit v1.2.3