From ffde7e4787f9089f631bf5ab6b57e75020130aaa Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Sat, 16 Jan 2016 21:04:35 +0200 Subject: [PATCH 1/2] Fix the name of ranges highlighters upon initialization --- src/highlighters.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index 899f725f..740320ac 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -1024,7 +1024,7 @@ HighlighterAndId create_ranges_highlighter(HighlighterParameters params) } }; - return {"hlranges_" + params[1], make_simple_highlighter(func) }; + return {"hlranges_" + params[0], make_simple_highlighter(func) }; } HighlighterAndId create_highlighter_group(HighlighterParameters params) From 5c189887e0dcffe93d1d54fa0f00938676cd2f4b Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Sat, 16 Jan 2016 21:10:37 +0200 Subject: [PATCH 2/2] Factorize the code that parses the output of `aspell` --- rc/spell.kak | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rc/spell.kak b/rc/spell.kak index 80043cfc..d970daba 100644 --- a/rc/spell.kak +++ b/rc/spell.kak @@ -16,15 +16,11 @@ def spell %{ while read line; do case $line in \&*) - word=$(printf %s "$line" | cut -d ' ' -f 2) begin=$(printf %s "$line" | cut -d ' ' -f 4 | sed 's/:$//') - end=$((begin + ${#word})) - # echo "echo -debug -- line: $line_num, word: $word, begin: $begin, end: $end" - regions="$regions:$line_num.$begin,$line_num.$end|Error" - ;; + ;& '#'*) word=$(printf %s "$line" | cut -d ' ' -f 2) - begin=$(printf %s "$line" | cut -d ' ' -f 3) + begin=${begin:-$(printf %s "$line" | cut -d ' ' -f 3)} end=$((begin + ${#word})) # echo "echo -debug -- line: $line_num, word: $word, begin: $begin, end: $end" regions="$regions:$line_num.$begin,$line_num.$end|Error"