summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-02-09 21:09:17 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-02-09 21:09:17 +0000
commit56dd5f9540d752b4af4e252aaf0cdfe1ab3c90a0 (patch)
treed7df0930919ea081318e3df95e5e3b76a00bfe35 /src
parentec1d5509bb95fcb91a2a05224e8ee5ccb638495d (diff)
Fix selecting of insert text in SelectionList::insert
Diffstat (limited to 'src')
-rw-r--r--src/selection.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/selection.cc b/src/selection.cc
index 91527080..936e8144 100644
--- a/src/selection.cc
+++ b/src/selection.cc
@@ -499,8 +499,11 @@ void SelectionList::insert(ArrayView<String> strings, InsertMode mode,
if (select_inserted or mode == InsertMode::Replace)
{
- sel.min() = change.begin;
- sel.max() = m_buffer->char_prev(change.end);
+ // we want min and max from *before* we do any change
+ auto& min = sel.min();
+ auto& max = sel.max();
+ min = change.begin;
+ max = m_buffer->char_prev(change.end);
}
else
{