From 730e5725e9d4532ccf3f45a00e052dad215eaf6a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 2 Nov 2017 11:08:03 +0800 Subject: [PATCH] Wrap: change indent atom to be a replaced empty buffer range Avoid confusing the column highlighters. --- src/highlighters.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index aec2e3ac..ade701e7 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -700,7 +700,10 @@ struct WrapHighlighter : Highlighter line.erase(atom_it, line.end()); if (indent != 0) - new_line.insert(new_line.begin(), DisplayAtom{String{' ', indent}}); + { + auto it = new_line.insert(new_line.begin(), {buffer, coord, coord}); + it->replace(String{' ', indent}); + } if (it+1 - display_buffer.lines().begin() == win_height) {