aboutsummaryrefslogtreecommitdiff
path: root/spellcheck.lua
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-03-30 14:39:20 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-03-30 14:39:20 +0200
commitd71e6bd763f0e32f38aaec9cc66f5a3c4e533886 (patch)
tree149a3af63cbf720215c129dd7c85b3dc86473d99 /spellcheck.lua
parentc51c07a7aabdb350c89b51bafabbd5c9885065ae (diff)
downloadvis-spellcheck-d71e6bd763f0e32f38aaec9cc66f5a3c4e533886.tar.gz
vis-spellcheck-d71e6bd763f0e32f38aaec9cc66f5a3c4e533886.zip
don't delete word if correction is empty
Diffstat (limited to 'spellcheck.lua')
-rw-r--r--spellcheck.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/spellcheck.lua b/spellcheck.lua
index d569efc..54cffc4 100644
--- a/spellcheck.lua
+++ b/spellcheck.lua
@@ -115,7 +115,7 @@ vis:map(vis.modes.NORMAL, "<C-w>w", function(keys)
f:close()
-- trim correction
correction = correction:match("^%s*(.-)%s*$")
- if correction then
+ if correction ~= "" then
win.file:delete(range)
win.file:insert(range.start, correction)
end