summaryrefslogtreecommitdiff
path: root/src/selection.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-05-22 09:52:22 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-05-24 02:14:28 +0100
commit695c85f4513241c55296a37d2cf6cf0cd25dbecf (patch)
tree007404cc54a173a8478f4954037e394ca445ec80 /src/selection.cc
parenta7540962cc90266f4f46858184b89f048364f9b2 (diff)
Fix, cleanup and refactor compute_modifications
Diffstat (limited to 'src/selection.cc')
-rw-r--r--src/selection.cc14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/selection.cc b/src/selection.cc
index 6b00dc54..f2126975 100644
--- a/src/selection.cc
+++ b/src/selection.cc
@@ -133,19 +133,6 @@ void update_erase(std::vector<Selection>& sels, ByteCoord begin, ByteCoord end,
on_buffer_change<UpdateErase>(sels, begin, end, at_end, end.line);
}
-static ByteCoord update_pos(memoryview<Modification> modifs, ByteCoord pos)
-{
- auto modif_it = std::upper_bound(modifs.begin(), modifs.end(), pos,
- [](const ByteCoord& c, const Modification& m)
- { return c < m.old_coord; });
- if (modif_it != modifs.begin())
- {
- auto& prev = *(modif_it-1);
- return prev.get_new_coord(pos);
- }
- return pos;
-}
-
void SelectionList::update()
{
if (m_timestamp == m_buffer->timestamp())
@@ -163,6 +150,7 @@ void SelectionList::update()
sel.cursor() = cursor;
}
+ merge_overlapping(overlaps);
check_invariant();
m_timestamp = m_buffer->timestamp();