Commit Graph

52 Commits

Author SHA1 Message Date
Maxime Coste
ed68d1ff28 utf8: use end of sequence iterators for more security 2014-07-05 12:10:06 +01:00
Maxime Coste
9870ac22f6 Remove Modification
Lets consider that as a failed experiment.

You see, I learned something today, for a complicated problem, it
is important to keep as much knowledge of the exact problem as
possible. the Modification approach failed because it tried to
solve the general problem, which is quite complex. The new approach,
which keeps the knowledge that selections are sorted is much simpler
and faster (see f49bec8021).
2014-05-26 21:09:12 +01:00
Maxime Coste
b6b646e9a2 Remove use of 'offset' in buffer iterators, lines are just String
No need to maintain line offsets anymore.
2014-05-24 17:08:01 +01:00
Maxime Coste
0aa5c4e779 Still more fixes for Modification 2014-05-24 13:15:59 +01:00
Maxime Coste
a6de024c1f Fix Modification 2014-05-24 02:35:08 +01:00
Maxime Coste
695c85f451 Fix, cleanup and refactor compute_modifications 2014-05-24 02:14:28 +01:00
Maxime Coste
2c52b8bca6 Add initial (and probably buggy) compute_modifications code
compute_modifications compiles a list of buffer change into
a list of Modifications that can be used for updating BufferCoord
2014-05-21 23:35:10 +01:00
Maxime Coste
8546788b43 Refactor LineAndColumn coordinates
BufferCoord -> ByteCoord
DisplayCoord -> CharCoord

Moved their definition along with LineAndColumn into coord.hh
2014-05-07 19:53:45 +01:00
Maxime Coste
389308dfd8 Preserve current word in word completion if found elsewhere
If occurence count in the buffer if greater that one, do not
remove it from the matches.
2014-04-22 19:32:12 +01:00
Maxime Coste
997aadd33f Word completion use a WordDB stored as a buffer value. 2014-01-16 22:07:42 +00:00
Maxime Coste
c0973075fa Get rid of Editor for good
ClientManager now stores only the free windows, clients take
ownership of its own.
2013-12-20 20:14:57 +00:00
Maxime Coste
7267b8281f Move insert and erase to normal.cc, and move edition management to context 2013-12-15 20:23:02 +00:00
Maxime Coste
ce0e71aacb Remove Editor::select methods, add a non-const selections getter 2013-12-14 18:38:14 +00:00
Maxime Coste
6afef079b6 Remove Editor::main_selection(|index), directly use the SelectionList method 2013-12-14 14:38:17 +00:00
Maxime Coste
dad27fe1a0 Remove simple selectors, always go through a multi selector 2013-12-14 14:38:17 +00:00
Maxime Coste
04ae48c346 indent cleanup, correct erroneous 3 spaces indent 2013-11-14 00:12:15 +00:00
Maxime Coste
3e12507636 Remove IncrementalInserter and move it's code to InputModes::Insert 2013-11-04 22:02:43 +00:00
Maxime Coste
bab10f5b93 add subsequence_match(str, subseq) utility function 2013-09-23 21:17:16 +02:00
Maxime Coste
5ae43acf94 Add prefix_match function and use it instead of adhoc code 2013-09-23 21:16:25 +02:00
Maxime Coste
3c8df764be fix insert mode erase utf-8 handling, add unit test 2013-07-30 19:18:01 +01:00
Maxime Coste
b5db256384 string escaping support functions
the split function now takes an additional escape parameter and
does not split on separators that have the escaper before it.

An utility escape function that adds escape before separators
is also added.
2013-07-24 22:37:17 +02:00
Maxime Coste
59b996be75 add an UndoGroupOptimizer test 2013-06-06 19:54:13 +02:00
Maxime Coste
2a74b0e9e2 Buffer: insert and erase go back to taking iterators, and return iterators 2013-06-06 19:44:08 +02:00
Maxime Coste
6b667bc803 remove BufferIterator conversion to/from BufferCoord 2013-06-06 19:44:07 +02:00
Maxime Coste
c4f9253634 Remove Buffer::iterator_at_line_{begin,end}, use iterator_at(line{,+1}) 2013-06-04 14:21:07 +02:00
Maxime Coste
4ef1bfa4db Use coord instead of iterators for selections 2013-06-04 14:21:07 +02:00
Maxime Coste
b51799a2b2 Explicitly pass buffer to selectors 2013-06-01 14:22:57 +02:00
Maxime Coste
93dd1ff3c7 Remove begin/end from Ranges, replace with min/max
Ranges should not be utf8 aware (needed for end), and a lot of
uses for end() were in fact looking for max.
2013-05-30 13:59:38 +02:00
Maxime Coste
9a80a58ff4 buffer end should not be in a selection 2013-05-30 13:59:38 +02:00
Maxime Coste
26f0fd4cc6 Use more std::* for string handling 2013-05-13 18:43:38 +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
1ab8120147 refactor regex based selectors, move regex construction out of them 2013-04-05 19:28:08 +02: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
9f4498e035 Buffer: replace {begin,end}_undo_group with a single commit_undo_group method 2013-02-20 14:20:16 +01:00
Maxime Coste
1c301482d5 tweak buffer unit test 2013-01-31 18:59:23 +01:00
Maxime Coste
7f02ef334f add some tests for Key functions 2013-01-30 19:16:36 +01:00
Maxime Coste
72cc61c987 add undo unit_test and fix Buffer 2013-01-23 14:39:33 +01:00
Maxime Coste
0955ef5eb0 add an empty buffer unit test 2012-11-28 20:10:49 +01:00
Maxime Coste
c32a7b9b74 Buffer takes a vector of lines as initial content 2012-11-23 18:42:07 +01:00
Maxime Coste
11e885e5a5 Cleanups and minor refactoring on Buffer 2012-11-22 18:54:37 +01:00
Maxime Coste
8bbfbc8c72 Buffer: replace Buffer::Type with Buffer::Flags 2012-11-20 19:47:56 +01:00
Maxime Coste
eed8a2a57c add basic utf8 unit test 2012-10-22 01:05:56 +02:00
Maxime Coste
efc069b531 Extract IncrementalInserter::Mode as InsertMode
move ClientMode classes in a namespace due to InsertMode name collisions
2012-09-26 14:22:24 +02:00
Maxime Coste
f9e31856cf Buffer: Allow inserting at the end when the inserted text ends with an end of line
Adapted other code in consequence and added unit tests so that this behavior
is maintained.
2012-09-10 19:26:17 +02:00
Maxime Coste
69bebdb44e fix open line above for first line and add a unit test 2012-09-03 23:46:04 +02:00
Maxime Coste
759319ca44 Buffer: move back Modification as an implementation detail
* Filters now only works on insertion and take directly the
   iterator and content
 * use Buffer::insert and Buffer::erase to modify a buffer
2012-08-10 19:12:43 +02:00
Maxime Coste
5a671db12c Correct multi select unit test 2012-07-16 21:14:52 +02:00
Maxime Coste
62202a46c1 Add some string helpers and unit tests
functions int_to_str(int) and split(const String&, Character),
plus corresponding unit tests
2012-05-29 05:19:50 +00:00