Commit Graph

66 Commits

Author SHA1 Message Date
Maxime Coste
335c73a09b Use custom implementation rather the sscanf in str_to_int 2015-03-30 23:37:55 +01:00
Maxime Coste
13a5af70ae Add a format function for printf like formatting 2015-03-30 23:05:24 +01:00
Maxime Coste
348e23dd8a Remove unused StaticString 2015-03-12 09:52:33 +00:00
Maxime Coste
092dcd174f Add StaticStringStorage for storing string literals 2015-02-28 17:09:29 +00:00
Maxime Coste
0b4ecef2d2 Rewrite line modifications, hopefully with easier to comprehend code 2015-01-31 23:50:24 +00:00
Maxime Coste
cb197f57ba Avoid temporary strings on buffer load/reload
Pass directly a Vector<ref_ptr<StringStorage>> to the buffer
2015-01-22 13:39:29 +00:00
Maxime Coste
da562e03a0 replace all std::vector with Vector 2015-01-12 13:58:41 +00:00
Maxime Coste
83d0813b0f Yet more tracking 2015-01-12 13:45:44 +00:00
Maxime Coste
dedb16bc73 Track some more memory 2015-01-11 19:28:03 +00:00
Maxime Coste
9f9156a752 Track String memory allocations 2015-01-09 13:57:21 +00:00
Maxime Coste
79de7ee717 Code refactoring in WordDB 2014-12-23 19:32:42 +00:00
Maxime Coste
69113e2711 Add a split function that does not take an escape and returns StringViews
When an escape character is not present, split can just return sub
strings of the parameter, so we can avoid duplicating the original
string data.
2014-10-19 16:27:36 +01:00
Maxime Coste
b097bbbf52 WordDB: Use interned strings pointing directly into the buffer line data 2014-10-07 09:16:19 +01:00
Maxime Coste
d55d041c6a Add support for interned strings
Use interned strings for Modification contents and word database.
Interned strings are guaranteed not to move in memory and are
reference counted.
2014-10-01 00:20:12 +01:00
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