summaryrefslogtreecommitdiff
path: root/src/display_buffer.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2023-06-12 14:38:31 +1000
committerMaxime Coste <mawww@kakoune.org>2023-06-12 16:26:22 +1000
commitaf66a95ef882447ca7bdc2149a8dfde50035301e (patch)
treeeae2a373b6102aca954b5fb0a8b3d7d2b2a223f1 /src/display_buffer.hh
parent5a867ebdd1dac274da185f4a4630b8480181cb9b (diff)
Trim display lines before the colorize pass
Colorizing long lines can be costly, remove all the invisible atoms earlier. Also optimize ForwardHighlighterApplier further by trimming empty lines.
Diffstat (limited to 'src/display_buffer.hh')
-rw-r--r--src/display_buffer.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/display_buffer.hh b/src/display_buffer.hh
index e3b4983e..23948263 100644
--- a/src/display_buffer.hh
+++ b/src/display_buffer.hh
@@ -54,8 +54,8 @@ public:
void replace(String text)
{
- kak_assert(m_type == Range);
- m_type = ReplacedRange;
+ if (m_type == Range)
+ m_type = ReplacedRange;
m_text = std::move(text);
}