From c51c07a7aabdb350c89b51bafabbd5c9885065ae Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 17 Jan 2020 15:32:02 +0100 Subject: fix corrections containing whitespace --- spellcheck.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spellcheck.lua b/spellcheck.lua index 6c16afc..d569efc 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -114,7 +114,7 @@ vis:map(vis.modes.NORMAL, "w", function(keys) local correction = f:read("*all") f:close() -- trim correction - correction = correction:match("%S+") + correction = correction:match("^%s*(.-)%s*$") if correction then win.file:delete(range) win.file:insert(range.start, correction) -- cgit v1.2.3