summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-01-20 02:11:07 +0000
committerMaxime Coste <frrrwww@gmail.com>2016-01-20 02:11:07 +0000
commit2bc24d6889abdf892a17c73ccd82f22dd1765a29 (patch)
tree88149a60dd4f1ce63367c6c34c5ea48e776cd021
parent31bda2f48b1b8b0fc5a662e0cfc385b81e255e69 (diff)
parent5c189887e0dcffe93d1d54fa0f00938676cd2f4b (diff)
Merge remote-tracking branch 'lenormf/fix-ranges-hl'
-rw-r--r--rc/spell.kak8
-rw-r--r--src/highlighters.cc2
2 files changed, 3 insertions, 7 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"
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)