aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2024-04-25 08:09:48 -0600
committerFlorian Fischer <florian.fischer@muhq.space>2024-04-26 09:47:16 +0200
commitdc41e741da7398c316e9875c23d6f9efda748bb1 (patch)
treea0c879573a555a7320d5960eee22bdc103f57b85
parent44211e9099d0800fb5d35f2367247f0085abcbb7 (diff)
downloadvis-spellcheck-dc41e741da7398c316e9875c23d6f9efda748bb1.tar.gz
vis-spellcheck-dc41e741da7398c316e9875c23d6f9efda748bb1.zip
cleanup some old vis API usage
The vis lexer hasn't used redrawtime for a while and it has been removed from the API.
-rw-r--r--spellcheck.lua15
1 files changed, 4 insertions, 11 deletions
diff --git a/spellcheck.lua b/spellcheck.lua
index d09f1e9..4af97ad 100644
--- a/spellcheck.lua
+++ b/spellcheck.lua
@@ -195,15 +195,8 @@ local wrapped_lex_funcs = {}
local wrap_lex_func = function(old_lex_func)
local old_new_tokens = {}
- return function(lexer, data, index, redrawtime_max)
- local tokens, timedout = old_lex_func(lexer, data, index, redrawtime_max)
-
- -- quit early if the lexer already took to long
- -- TODO: investigate further if timedout is actually set by the lexer.
- -- As I understand lpeg.match used by lexer.lex timedout will always be nil
- if timedout then
- return tokens, timedout
- end
+ return function(lexer, data, index)
+ local tokens = old_lex_func(lexer, data, index)
local new_tokens = {}
@@ -211,7 +204,7 @@ local wrap_lex_func = function(old_lex_func)
if last_data ~= data then
typos = get_typos(data)
if not typos then
- return tokens, timedout
+ return tokens
end
last_data = data
else
@@ -266,7 +259,7 @@ local wrap_lex_func = function(old_lex_func)
end
old_new_tokens = new_tokens
- return new_tokens, timedout
+ return new_tokens
end
end