diff options
| author | Maxime Coste <mawww@kakoune.org> | 2022-07-11 18:17:51 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2022-07-11 18:17:51 +1000 |
| commit | 50cacc0758ea7e6acd7dcc350f8dbb2e6559a30e (patch) | |
| tree | b30d5fbdff8b598cbe38d7719b8f5ad12015a6b6 /src/display_buffer.cc | |
| parent | ce75867e441a1ebde0e3d9e434672a05b49bd9e3 (diff) | |
Fix buffer location of column highlighter's past-eol atoms
Using buffer end was confusing Window::display_position that
assumes display atom buffer locations are always increasing.
Diffstat (limited to 'src/display_buffer.cc')
| -rw-r--r-- | src/display_buffer.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/display_buffer.cc b/src/display_buffer.cc index a1dfbc36..2b377310 100644 --- a/src/display_buffer.cc +++ b/src/display_buffer.cc @@ -134,7 +134,7 @@ DisplayLine::iterator DisplayLine::insert(iterator it, DisplayAtom atom) return res; } -void DisplayLine::push_back(DisplayAtom atom) +DisplayAtom& DisplayLine::push_back(DisplayAtom atom) { if (atom.has_buffer_range()) { @@ -142,6 +142,7 @@ void DisplayLine::push_back(DisplayAtom atom) m_range.end = std::max(m_range.end, atom.end()); } m_atoms.push_back(std::move(atom)); + return m_atoms.back(); } DisplayLine::iterator DisplayLine::erase(iterator beg, iterator end) |
