From 90ba4d0903bc3e1af3d3f84db303d123222897d8 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Sat, 1 Feb 2020 15:55:32 +0100 Subject: [PATCH] rc spell: Handle errors returned on the first line The first line returned by `aspell` isn't always an identification string, it can also be an error. This commit prevents the first line from being ignored in any case, and allows errors to be reported consistently. Related to #3330 --- rc/tools/spell.kak | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc/tools/spell.kak b/rc/tools/spell.kak index 47ada22f..0eeaceb5 100644 --- a/rc/tools/spell.kak +++ b/rc/tools/spell.kak @@ -40,9 +40,11 @@ define-command -params ..1 -docstring %{ sed 's/^/^/' "$kak_opt_spell_tmp_file" | eval "aspell --byte-offsets -a $options" 2>&1 | { line_num=1 regions=$kak_timestamp - read line # drop the identification message while read -r line; do case "$line" in + @\(\#\)*) + # drop the identification message + ;; [\#\&]*) if expr "$line" : '^&' >/dev/null; then pos=$(printf %s\\n "$line" | cut -d ' ' -f 4 | sed 's/:$//')