aboutsummaryrefslogtreecommitdiff
path: root/spellcheck.lua
diff options
context:
space:
mode:
authorNomarian <nomarian@outlook.com>2025-10-12 14:26:33 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-10-12 21:00:45 +0200
commit47c68382bdcd864efb098b309fcf113a51b79a21 (patch)
tree60014ca994f95f82e795f68b39dcda287358050e /spellcheck.lua
parentec0be43e90d7058ea822b8f60c9e62900e7d9bea (diff)
downloadvis-spellcheck-47c68382bdcd864efb098b309fcf113a51b79a21.tar.gz
vis-spellcheck-47c68382bdcd864efb098b309fcf113a51b79a21.zip
Eliminated function call syntax sugar for strings
Diffstat (limited to 'spellcheck.lua')
-rw-r--r--spellcheck.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/spellcheck.lua b/spellcheck.lua
index 5217c97..3ef5e04 100644
--- a/spellcheck.lua
+++ b/spellcheck.lua
@@ -16,22 +16,22 @@ spellcheck.get_lang = function()
end
local which do
- local path = os.getenv"PATH":gsub(":","/?;") .. "/?"
+ local path = os.getenv("PATH"):gsub(":","/?;") .. "/?"
function which(executable)
return package.searchpath(executable, path, "", "")
end
end
-if which"enchant" then
+if which("enchant") then
spellcheck.cmd = 'enchant -d %s -a'
spellcheck.list_cmd = 'enchant -l -d %s'
-elseif which"enchant-2" then
+elseif which("enchant-2") then
spellcheck.cmd = 'enchant-2 -d %s -a'
spellcheck.list_cmd = 'enchant-2 -l -d %s'
-elseif which"aspell" then
+elseif which("aspell") then
spellcheck.cmd = 'aspell pipe -l %s'
spellcheck.list_cmd = 'aspell list -l %s'
-elseif which"hunspell" then
+elseif which("hunspell") then
spellcheck.cmd = 'hunspell -d %s'
spellcheck.list_cmd = 'hunspell -l -d %s'
else
@@ -114,7 +114,7 @@ end
-- Which will return the next typo and its start and finish in the text, starting by 1.
local function typo_iter(text, typos, ignored) -- luacheck: ignore ignored
local index = 1
- local unfiltered_iterator, iter_state = typos:gmatch'[^\n]+'
+ local unfiltered_iterator, iter_state = typos:gmatch('[^\n]+')
return function()
local typo