summaryrefslogtreecommitdiff
path: root/src/selection.cc
AgeCommit message (Collapse)Author
2014-05-29Use forward iteration on selections, and take advantage of it when updatingMaxime Coste
SelectionList::update now is optimized for the common case where changes are sorted, the algorithm is O(m*n) with m the number of sorted ranges in the changes. In the common case, m should be very small.
2014-05-26Go back to Buffer::Change based implementation for SelectionList::updateMaxime Coste
However take into account the ordering of selections in insert and erase methods, so that we update selection position cheaply.
2014-05-25Use SelectionList::insert in InputModes::InsertMaxime Coste
2014-05-25Move insert/erase methods from normal.cc to member functions in SelectionListMaxime Coste
It does look like the Editor class is attempting a sneaky comeback...
2014-05-24Clamp modified coord in Selection as it could be buffer endMaxime Coste
2014-05-24Fix, cleanup and refactor compute_modificationsMaxime Coste
2014-05-21Add initial (and probably buggy) compute_modifications codeMaxime Coste
compute_modifications compiles a list of buffer change into a list of Modifications that can be used for updating BufferCoord
2014-05-14Iterate in reversed order on selections when modifing bufferMaxime Coste
This way, update only needs to be called once everything is done as we always modify after the next selection to be used.
2014-05-14Use a plain SelectionList for Context, remove DynamicSelectionListMaxime Coste
2014-05-14utf8::is_character_start takes directly the char valueMaxime Coste
2014-05-13Make it harder to have an invalid SelectionListMaxime Coste
2014-05-13SelectionList know its buffer and timestampMaxime Coste
2014-05-13Pass a at_end param to BufferChangeListener::on_{insert,erase}Maxime Coste
2014-05-07Refactor LineAndColumn coordinatesMaxime Coste
BufferCoord -> ByteCoord DisplayCoord -> CharCoord Moved their definition along with LineAndColumn into coord.hh
2014-04-08Minor formatting fixes (very long lines)Maxime Coste
2014-03-29Remove Range struct, merge it back in SelectionMaxime Coste
2014-01-28Rename selections first,last to more explicit anchor,cursorMaxime Coste
2013-12-14SelectionList should never be emptyMaxime Coste
2013-12-14Move main selection index to SelectionListMaxime Coste
2013-07-26LineAndColumns: always pass by valueMaxime Coste
2013-06-04Use coord instead of iterators for selectionsMaxime Coste
2013-06-01BufferChangeListener: pass buffer to on_{inser,erase}Maxime Coste
2013-05-30reorganize check_invariant in SelectionListMaxime Coste
2013-05-30Remove Range::contentMaxime Coste
2013-05-30Remove begin/end from Ranges, replace with min/maxMaxime Coste
Ranges should not be utf8 aware (needed for end), and a lot of uses for end() were in fact looking for max.
2013-05-30buffer end should not be in a selectionMaxime Coste
2013-05-29Remove Selection::avoid_eol, move as static func in editor.ccMaxime Coste
Conflicts: src/editor.cc
2013-05-14tweak Range::merge_with behaviourMaxime Coste
2013-05-03add SelectionList::check_invariantMaxime Coste
2013-05-02Move selection update code to SelectionListMaxime Coste
2013-04-09rename assert to kak_assert to avoid collisionsMaxime Coste
2013-02-27Add String Range::content() constMaxime Coste
2013-02-27Add a debug option to Makefile, and use KAK_DEBUG define to remove debug codeMaxime Coste
2013-01-23add more assertsMaxime Coste
2012-12-13move selection updating code out of selection, to DynamicSelectionListMaxime Coste
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-11-30Selection: refactoring, move CaptureList to SelectionMaxime Coste
2012-11-12make Buffer::{add,remove}_change_listener const and the listener list mutableMaxime Coste
2012-10-08selections should always point to an utf8 character sequence start byteMaxime Coste
2012-09-05fix Selection::merge_withMaxime Coste
2012-08-15avoid keeping end of lines selected in Editor::eraseMaxime Coste
2012-07-16Go back to a generic BufferChangeListener interface for selection updateMaxime Coste
2012-04-04remove ModificationListener and use a list of iterators to update insteadMaxime Coste
This permits to fix a bug in BufferIterator::upgrade, replaced by BufferIterator::on_insert and BufferIterator::on_erase. ModificationListener was only used to updating iterators anyway.
2012-03-30Store buffer content in a list of linesMaxime Coste
Instead of a big std::string, buffer now store it's content in a list of lines. In order to achieve O(log(n)) random access, lines contains both their content and their offset since the start of the file, making binary search usable. BufferIterator now have a LineAndColumn coordinate into the buffer instead of an offset so that access is still O(1).
2012-02-22Selection: handle last buffer character deleted caseMaxime Coste
2012-02-09Merge captures into registers, implements register insertionMaxime Coste
2012-01-31extract an Editor class from Window and refactorMaxime Coste