summaryrefslogtreecommitdiff
path: root/src/display_buffer.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-04-27 13:36:12 +1000
committerMaxime Coste <mawww@kakoune.org>2020-04-27 17:39:21 +1000
commit954373d3cfa9d168f7949f12cb7b2e730d18de99 (patch)
tree780e9cd53936d9d0fa54d0dea2b7edf5203e7123 /src/display_buffer.hh
parent65620fb8306f65247c8a2fb9732aa68dfe707308 (diff)
Support multi-line replace-ranges
This likely has lots of rough edges, but should be an initial proof of concept to support folding.
Diffstat (limited to 'src/display_buffer.hh')
-rw-r--r--src/display_buffer.hh15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/display_buffer.hh b/src/display_buffer.hh
index abd1a244..308b1993 100644
--- a/src/display_buffer.hh
+++ b/src/display_buffer.hh
@@ -126,16 +126,27 @@ public:
// returns an iterator to the first atom
iterator split(iterator it, ColumnCount pos);
+ iterator split(BufferCoord pos);
+
iterator insert(iterator it, DisplayAtom atom);
+
+ template<typename It>
+ iterator insert(iterator it, It beg, It end)
+ {
+ auto res = m_atoms.insert(it, beg, end);
+ compute_range();
+ return res;
+ }
+
iterator erase(iterator beg, iterator end);
- void push_back(DisplayAtom atom);
+ void push_back(DisplayAtom atom);
// remove first_col from the begining of the line, and make sure
// the line is less that col_count character
bool trim(ColumnCount first_col, ColumnCount col_count);
// Merge together consecutive atoms sharing the same display attributes
- void optimize();
+ void optimize();
private:
void compute_range();
BufferRange m_range = { { INT_MAX, INT_MAX }, { INT_MIN, INT_MIN } };