summaryrefslogtreecommitdiff
path: root/src/display_buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2022-07-10 10:04:15 +1000
committerMaxime Coste <mawww@kakoune.org>2022-07-10 14:58:24 +1000
commit94f5479e1aa4834930a358f2b6fc1d300658042e (patch)
tree77a745c12d433cb1f459a875490aece97bd001b2 /src/display_buffer.cc
parentf3cb2e434004a718d1225cb0d74c694e66a7248b (diff)
Refactor highlighting logic
Always start with full buffer lines and trim the display buffer at the very end, treat non-range display atoms as non-trimable in that case and keep track of how many columns are occupied by "widgets" such as line numbers or flags. Fixes #4659
Diffstat (limited to 'src/display_buffer.cc')
-rw-r--r--src/display_buffer.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/display_buffer.cc b/src/display_buffer.cc
index d98108cd..a1dfbc36 100644
--- a/src/display_buffer.cc
+++ b/src/display_buffer.cc
@@ -192,10 +192,16 @@ ColumnCount DisplayLine::length() const
return len;
}
-bool DisplayLine::trim(ColumnCount first_col, ColumnCount col_count)
+bool DisplayLine::trim(ColumnCount first_col, ColumnCount col_count, bool only_buffer)
{
for (auto it = begin(); first_col > 0 and it != end(); )
{
+ if (only_buffer and !it->has_buffer_range())
+ {
+ ++it;
+ continue;
+ }
+
auto len = it->length();
if (len <= first_col)
{