diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-01-03 18:41:45 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-01-03 18:41:45 +0000 |
| commit | 4295736c972ffda876b499d09c5815a6a38cef91 (patch) | |
| tree | 405f9aef568b37830975a2f311df07c46c6ef037 /src/selection.hh | |
| parent | 5763cbb9274a7bce12d192658f2e00da26af6688 (diff) | |
Fix handling of main selection when copying selection to next/previous lines
Fixes #1095
Diffstat (limited to 'src/selection.hh')
| -rw-r--r-- | src/selection.hh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/selection.hh b/src/selection.hh index 92eecea6..edf8e601 100644 --- a/src/selection.hh +++ b/src/selection.hh @@ -101,12 +101,18 @@ struct SelectionList SelectionList& operator=(Vector<Selection> list) { + set(std::move(list), list.size()-1); + return *this; + } + + void set(Vector<Selection> list, size_t main) + { + kak_assert(main < list.size()); m_selections = std::move(list); - m_main = size()-1; + m_main = main; sort_and_merge_overlapping(); update_timestamp(); check_invariant(); - return *this; } using iterator = Vector<Selection>::iterator; |
