From bee2180da78735de6db8173c4c6c9970e546d5c9 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 19 Apr 2017 21:15:36 +0100 Subject: [PATCH] Do not try to split non range atoms in column highlighter That means we wont have a very nice interaction between show_whitespaces and column highlighters, but thats the simplest fix for now, if we want a better behaviour we need to introduce a way to know that a replaced range is splittable (meaning it means to have the same amount of columns as the range it replaces) Fixes #1275 --- src/highlighters.cc | 2 +- test/regression/1275-replaced-range-split/cmd | 1 + test/regression/1275-replaced-range-split/in | 1 + test/regression/1275-replaced-range-split/out | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 test/regression/1275-replaced-range-split/cmd create mode 100644 test/regression/1275-replaced-range-split/in create mode 100644 test/regression/1275-replaced-range-split/out diff --git a/src/highlighters.cc b/src/highlighters.cc index c1969a944..0b1177556 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -573,7 +573,7 @@ HighlighterAndId create_column_highlighter(HighlighterParameters params) { for (auto atom_it = line.begin(); atom_it != line.end(); ++atom_it) { - if (!atom_it->has_buffer_range()) + if (atom_it->type() != DisplayAtom::Range) continue; kak_assert(atom_it->begin().line == buf_line); diff --git a/test/regression/1275-replaced-range-split/cmd b/test/regression/1275-replaced-range-split/cmd new file mode 100644 index 000000000..1e0db3c13 --- /dev/null +++ b/test/regression/1275-replaced-range-split/cmd @@ -0,0 +1 @@ +:addhl show_whitespacesi:addhl column 1 redA diff --git a/test/regression/1275-replaced-range-split/in b/test/regression/1275-replaced-range-split/in new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/test/regression/1275-replaced-range-split/in @@ -0,0 +1 @@ + diff --git a/test/regression/1275-replaced-range-split/out b/test/regression/1275-replaced-range-split/out new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/test/regression/1275-replaced-range-split/out @@ -0,0 +1 @@ +