aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2021-02-17 17:30:39 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2021-02-17 17:30:39 +0100
commit8bb9679a1bd201e9628ee6eaece9d56aecb2bc44 (patch)
tree25a1dd3e1f526ed580991670c9d1596e650baeb7
parentc7114a15ee1ab2b4678c0c201494be9028edd9d6 (diff)
downloadvis-spellcheck-8bb9679a1bd201e9628ee6eaece9d56aecb2bc44.tar.gz
don't try to use empty corrections
-rw-r--r--spellcheck.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/spellcheck.lua b/spellcheck.lua
index 080a1aa..e4bf709 100644
--- a/spellcheck.lua
+++ b/spellcheck.lua
@@ -332,6 +332,10 @@ vis:map(vis.modes.NORMAL, "<C-w>w", function(keys)
local suggestions = nil
local answer_line = so:match(".-\n(.-)\n.*")
+ if not answer_line then
+ return false
+ end
+
local first_char = answer_line:sub(0,1)
if first_char == "*" then
vis:info(file:content(range).." is correctly spelled")