Commit Graph

18 Commits

Author SHA1 Message Date
Maxime Coste
3862b5cbb8 LineAndColumns: always pass by value 2013-07-26 01:50:09 +02:00
Maxime Coste
4ef1bfa4db Use coord instead of iterators for selections 2013-06-04 14:21:07 +02:00
Maxime Coste
24ffd6abae DynamicSelectionList check that buffer end is not selected 2013-06-03 14:26:05 +02:00
Maxime Coste
3453ebbd52 BufferChangeListener: pass buffer to on_{inser,erase} 2013-06-01 00:48:46 +02:00
Maxime Coste
557acc5068 reorganize check_invariant in SelectionList 2013-05-30 13:59:38 +02:00
Maxime Coste
6c290eff9a Buffer::do_{erase,insert} takes coord parameters rather than iterators
BufferChangeListeners do as well use coord rather than iterators
2013-05-29 18:58:20 +02:00
Maxime Coste
4c4b6a404d add SelectionList::check_invariant 2013-05-03 18:44:26 +02:00
Maxime Coste
9b3e0c8055 Move selection update code to SelectionList 2013-05-02 19:04:59 +02:00
Maxime Coste
5adee4a6a7 rename assert to kak_assert to avoid collisions 2013-04-09 20:04:11 +02:00
Maxime Coste
22c34b79f6 Move change listener registration to BufferChangeListener_AutoRegister
DynamicSelectionList now just inherit from this class, so that
the registration logic can be shared.
2013-03-31 14:53:32 +02:00
Maxime Coste
e6c635be34 DynamicSelectionList: optimize updating on buffer modification
Now that we know selections are sorted, we can get the set of selections
needing updating in log(n) time using a binary search, for modification
not changing the line count, this makes updating selections run in log(n)
instead of n.
2013-03-18 19:09:07 +01:00
Maxime Coste
5e88b7fe28 move BufferIterator on_{insert,erase} as DynamicSelectionList implementation detail 2013-03-15 14:22:42 +01:00
Maxime Coste
be0c5ddf49 minor performance tweaks 2013-02-27 19:03:33 +01:00
Maxime Coste
edef8e4e98 Remove Set and use unordered_set 2013-01-31 18:58:25 +01:00
Maxime Coste
3404366b65 add more asserts 2013-01-23 14:39:33 +01:00
Maxime Coste
914ede7a82 Add and use a Set template class for recuring small sets 2013-01-11 14:28:13 +01:00
Maxime Coste
1c94064713 DynamicSelectionList: derive from SelectionList
the previous implementation did not preserve invariant
either, so we'd better use less code.
2012-12-13 18:50:27 +01:00
Maxime Coste
cfd7ee049a move selection updating code out of selection, to DynamicSelectionList
this avoids a lot of unnecessary (add|remove)_change_listener as
creating temporary Selections do not call that anymore.

Use can choose between a SelectionList which or a DynamicSelectionList
depending on wethear the buffer will be modified or not during the
selections lifetime.
2012-12-13 18:50:27 +01:00