From 72c5b69a00429bf62a8879c7ce5f2d6c204cc0cf Mon Sep 17 00:00:00 2001 From: Nomarian Date: Thu, 9 Oct 2025 11:42:22 -0400 Subject: typo_iter redundant pattern [%A] -> %A --- spellcheck.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spellcheck.lua') diff --git a/spellcheck.lua b/spellcheck.lua index 12e8d7b..5065774 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -135,7 +135,7 @@ local function typo_iter(text, typos, ignored) -- luacheck: ignore ignored -- to prevent typos from being found in correct words before them -- ("stuff stuf", "broken ok", ...) -- we match typos only when they are enclosed in non-letter characters. - local pattern = '[%A]' .. escape_lua_pattern(typo) .. '[%A]' + local pattern = '%A' .. escape_lua_pattern(typo) .. '%A' start, finish = text:find(pattern, index) if start then -- our pattern [%A]typo[%A] found it start = start + 1 -- ignore leading non letter char -- cgit v1.2.3