From 8bb9679a1bd201e9628ee6eaece9d56aecb2bc44 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 17 Feb 2021 17:30:39 +0100 Subject: don't try to use empty corrections --- spellcheck.lua | 4 ++++ 1 file changed, 4 insertions(+) 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, "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") -- cgit v1.2.3