summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2023-06-19 12:55:55 +1000
committerMaxime Coste <mawww@kakoune.org>2023-06-19 12:55:55 +1000
commite58592f00a61fe05a238bc106cd108f8a57ad291 (patch)
treee94639d2deef8e29d2dfab13e5fd54d13d477f86 /src
parent7027cccf822148463eed4de1ad9240fd3526ae8b (diff)
Fix highlighters being applied to empty display buffers
In some cases such as with folding we can end-up with regions not having any atoms to highlight which can trigger a crash as we assume display buffers not to be empty Fixes #4926
Diffstat (limited to 'src')
-rw-r--r--src/highlighters.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/highlighters.cc b/src/highlighters.cc
index d2daa085..ee772469 100644
--- a/src/highlighters.cc
+++ b/src/highlighters.cc
@@ -1840,6 +1840,9 @@ struct ForwardHighlighterApplier
cur_atom = cur_line->begin();
}
+ if (region_lines.empty())
+ return;
+
region_display.compute_range();
highlighter.highlight(context, region_display, {begin, end});