From 50cacc0758ea7e6acd7dcc350f8dbb2e6559a30e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 11 Jul 2022 18:17:51 +1000 Subject: 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. --- src/display_buffer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/display_buffer.cc') 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) -- cgit v1.2.3