Commit Graph

93 Commits

Author SHA1 Message Date
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
9630990b74 Remove Selection::avoid_eol, move as static func in editor.cc
Conflicts:
	src/editor.cc
2013-05-29 18:53:57 +02:00
Maxime Coste
1fb971e389 Editor::select(Selection, SelectMode::Extend) now only keeps the extended main selection 2013-05-14 13:58:41 +02:00
Maxime Coste
33740d06ee Editor: tweak behaviour on undo/redo when selecting modified ranges 2013-05-03 18:44:26 +02:00
Maxime Coste
564cfb084e Editor: undo and redo select all ranges modified instead of the last one 2013-05-03 18:44:26 +02:00
Maxime Coste
270e950cf1 sort includes directives 2013-04-09 20:05:40 +02:00
Maxime Coste
5adee4a6a7 rename assert to kak_assert to avoid collisions 2013-04-09 20:04:11 +02:00
Maxime Coste
1fd99e7e88 do not check buffer invariant in do_{erase,insert} as this cause O(n²) behaviour 2013-04-04 14:04:37 +02:00
Maxime Coste
5bb8e656c5 Editor: fix utf8 handling in prepare_insert 2013-04-03 18:52:49 +02:00
Maxime Coste
d99fe87b43 Editor: fix select(Selection&, SelectMode::Replace) 2013-03-20 19:11:58 +01:00
Maxime Coste
354ae7ad89 Editor: keep selections sorted and use an index for the main one 2013-03-18 19:09:07 +01:00
Maxime Coste
a981d41cde Editor: replace selections().back() with main_selection() 2013-03-15 18:22:08 +01:00
Maxime Coste
0f957b3743 Editor: fix replace at end of buffer 2013-03-13 14:37:03 +01:00
Maxime Coste
298926a16e Editor::multi_select: reserve some vector space in advance 2013-02-28 18:51:58 +01:00
Maxime Coste
4ad8941563 Editor: fix move_selection(LineCount) when current column is after next line end 2013-02-27 21:09:48 +01:00
Maxime Coste
2f410f62e4 Add String Range::content() const 2013-02-27 19:11:25 +01:00
Maxime Coste
cd8c36fc50 Add a debug option to Makefile, and use KAK_DEBUG define to remove debug code 2013-02-27 19:02:01 +01:00
Maxime Coste
0f413607c2 Fix utf8 handling when moving selection up/down 2013-02-26 18:52:49 +01:00
Maxime Coste
c343407465 Fix utf8 handling in Editor::insert when replacing 2013-02-26 14:06:25 +01:00
Maxime Coste
5f446d9aec try to merge selections when begining incremental insertion 2013-02-21 18:44:17 +01:00
Maxime Coste
9f4498e035 Buffer: replace {begin,end}_undo_group with a single commit_undo_group method 2013-02-20 14:20:16 +01:00
Maxime Coste
2f9041b842 Editor: fix warning 2013-02-07 13:37:22 +01:00
Maxime Coste
edef8e4e98 Remove Set and use unordered_set 2013-01-31 18:58:25 +01:00
Maxime Coste
252f875926 fix sort_and_merge_overlapping 2013-01-29 19:05:40 +01:00
Maxime Coste
28cb78bed1 Editor: refactor InsertMode::Replace 2013-01-23 18:58:43 +01:00
Maxime Coste
3404366b65 add more asserts 2013-01-23 14:39:33 +01:00
Maxime Coste
44ca4d23de Fix sort_and_merge_overlapping 2013-01-17 19:49:48 +01:00
Maxime Coste
c45838cc57 Move Insertion Hooks handing to the input handler 2013-01-17 13:58:57 +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
4b649d386c various code style fixes 2013-01-04 18:39:13 +01:00
Maxime Coste
ae9aadb07d Fix captures preservation in Editor 2013-01-03 18:47:02 +01:00
Maxime Coste
02b9fcc3df Editor: add a ReplaceLast select mode 2013-01-03 14:00:31 +01:00
Maxime Coste
9fb0129061 Editor: keep last selection as last when sorting
sort selections 'circularly', keeping the last one
at the end of the list.
2013-01-03 13:59:53 +01:00
Maxime Coste
a9d5f126a0 Editor: preserve captures accross movements 2013-01-02 13:49:02 +01:00
Maxime Coste
476363bf0d Editor: cleanup check_invariants calls 2012-12-31 18:36:28 +01:00
Maxime Coste
76c3246642 Add Editor::select(const Selection&, SelectMode) 2012-12-31 14:06:20 +01:00
Maxime Coste
18b35a3ab3 Editor: merge_overlapping -> sort_and_merge_overlapping 2012-12-31 13:56:52 +01:00
Maxime Coste
cb80ae139b IncrementalInserter: fix append mode when on line end 2012-12-28 14:06:56 +01:00
Maxime Coste
030df1c4be IncrementalInserter: preserve captures 2012-12-27 19:11:42 +01:00
Maxime Coste
41979c91f4 Editor: when replacing, select inserted text 2012-12-27 18:54:52 +01:00
Maxime Coste
6cc4ec796e editor: support select mode on select(BufferIterator) 2012-12-18 19:12:15 +01:00
Maxime Coste
8e170e4385 optimize merge_overlappings
assume selections are sorted, so we have a linear complexity algorithm
instead of O(n²).
2012-12-13 18:50:27 +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
Maxime Coste
b764a0a63e Selection: refactoring, move CaptureList to Selection 2012-11-30 18:32:49 +01:00
Maxime Coste
557128b641 IncrementalInsert::move_cursors: use overloaded for LineCount/CharCount editor implementation 2012-11-26 19:38:07 +01:00
Maxime Coste
cad4d3c01e fix InsertMode::OpenLineBelow behaviour in prepare_insert 2012-11-26 19:24:38 +01:00
Maxime Coste
cee0a2d128 Append on end of line now appends to current line 2012-11-26 19:23:50 +01:00
Maxime Coste
e77ca7a4be minor code simplification 2012-11-26 18:50:34 +01:00
Maxime Coste
84db1e2b8c Editor: fix replacement beheviour just before end of line 2012-11-23 19:13:47 +01:00