parent
699d066ebd
commit
f9d421130f
|
@ -133,7 +133,7 @@ void apply_highlighter(HighlightContext context,
|
||||||
|
|
||||||
using LineIterator = DisplayBuffer::LineList::iterator;
|
using LineIterator = DisplayBuffer::LineList::iterator;
|
||||||
LineIterator first_line;
|
LineIterator first_line;
|
||||||
Vector<DisplayLine::iterator> insert_pos;
|
Vector<size_t> insert_idx;
|
||||||
auto line_end = display_buffer.lines().end();
|
auto line_end = display_buffer.lines().end();
|
||||||
|
|
||||||
DisplayBuffer region_display;
|
DisplayBuffer region_display;
|
||||||
|
@ -147,8 +147,6 @@ void apply_highlighter(HighlightContext context,
|
||||||
|
|
||||||
if (region_lines.empty())
|
if (region_lines.empty())
|
||||||
first_line = line_it;
|
first_line = line_it;
|
||||||
region_lines.emplace_back();
|
|
||||||
insert_pos.emplace_back();
|
|
||||||
|
|
||||||
if (range.begin < begin or range.end > end)
|
if (range.begin < begin or range.end > end)
|
||||||
{
|
{
|
||||||
|
@ -184,14 +182,16 @@ void apply_highlighter(HighlightContext context,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
region_lines.emplace_back();
|
||||||
std::move(line.begin() + beg_idx, line.begin() + end_idx,
|
std::move(line.begin() + beg_idx, line.begin() + end_idx,
|
||||||
std::back_inserter(region_lines.back()));
|
std::back_inserter(region_lines.back()));
|
||||||
insert_pos.back() = line.erase(line.begin() + beg_idx, line.begin() + end_idx);
|
auto it = line.erase(line.begin() + beg_idx, line.begin() + end_idx);
|
||||||
|
insert_idx.push_back(it - line.begin());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
region_lines.back() = std::move(line);
|
insert_idx.push_back(0);
|
||||||
insert_pos.back() = line.begin();
|
region_lines.push_back(std::move(line));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ void apply_highlighter(HighlightContext context,
|
||||||
for (size_t i = 0; i < region_lines.size(); ++i)
|
for (size_t i = 0; i < region_lines.size(); ++i)
|
||||||
{
|
{
|
||||||
auto& line = *(first_line + i);
|
auto& line = *(first_line + i);
|
||||||
auto pos = insert_pos[i];
|
auto pos = line.begin() + insert_idx[i];
|
||||||
for (auto& atom : region_lines[i])
|
for (auto& atom : region_lines[i])
|
||||||
pos = ++line.insert(pos, std::move(atom));
|
pos = ++line.insert(pos, std::move(atom));
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
If you're not reporting a bug (e.g. requesting a feature or asking a general question), feel free to remove this template.
|
||||||
|
Otherwise, please edit the following sections with the relevant information ().
|
|
@ -0,0 +1,5 @@
|
||||||
|
add-highlighter buffer/regions regions
|
||||||
|
add-highlighter buffer/regions/inline default-region regions
|
||||||
|
|
||||||
|
add-highlighter buffer/ wrap
|
||||||
|
add-highlighter buffer/ wrap -indent
|
Loading…
Reference in New Issue
Block a user