Commit Graph

33 Commits

Author SHA1 Message Date
Maxime Coste
52ee8b46ae fix crlf file reading 2012-11-26 13:36:43 +01:00
Maxime Coste
9c99c238e8 rewrite file opening code using mmap, opening big files is much much faster 2012-11-23 18:43:10 +01:00
Maxime Coste
3b5530ac09 rename (hook|option)_manager to (hook|option)s.
And Global(Hook|Option)Manager to Global(Hook|Option)s
2012-11-22 13:50:29 +01:00
Maxime Coste
d1fade5c9e Buffer: replace reset_undo_data with a NoUndo flag 2012-11-21 13:43:10 +01:00
Maxime Coste
8bbfbc8c72 Buffer: replace Buffer::Type with Buffer::Flags 2012-11-20 19:47:56 +01:00
Maxime Coste
713fa9d406 more exception safety with file descriptors 2012-11-20 18:52:36 +01:00
Maxime Coste
6ff6058ceb create_buffer_from file return nullptr on file not found instead of throwing 2012-10-16 14:59:39 +02:00
Maxime Coste
0ce6bd9bf5 use ByteCount instead of CharCount when we are really counting bytes
(that is most of the time when we are not concerned with displaying)
2012-10-11 00:41:48 +02:00
Maxime Coste
a467d73115 use parse_filename when opening files or completing filenames so that ~ and env vars are handled 2012-09-12 19:42:12 +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
e4fd839dda use a strongly typed int CharCount for character counts 2012-08-23 23:56:35 +02:00
Maxime Coste
0d8cce2728 use a strongly typed int LineCount for line counts 2012-08-22 23:33:52 +02:00
Maxime Coste
7cc5ff7c73 fix create_buffer_from_file when file does not exists 2012-08-17 18:52:04 +02:00
Maxime Coste
4e34f777b0 Buffer: stronger invariant, a buffer is never empty and all lines finish by '\n' 2012-08-14 14:13:10 +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
44621bff11 detect byte order mark in buffers, and write back 2012-08-10 18:48:21 +02:00
Maxime Coste
d81a100a85 support crlf line ending when reading and writing buffers 2012-08-10 14:24:13 +02:00
Maxime Coste
d7c917c96e include <unistd.h> in order to get read and write 2012-05-30 14:19:53 +02:00
Maxime Coste
b8fe942dbb Implement our own String class in preparation to encoding support. 2012-04-14 01:23:20 +00:00
Maxime Coste
9337938403 replace std::string references with String 2012-04-14 01:17:09 +00:00
Maxime Coste
0ba7c7286d Store buffer content in a list of lines
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-03-30 11:37:18 +00:00
Maxime Coste
792f0f7f2e BufferManager no longer owns buffers, only register them 2012-03-26 14:21:49 +00:00
Maxime Coste
df0f7b4689 rename BufferString to String 2012-03-08 21:23:29 +00:00
Maxime Coste
73a8950e73 File: parse_filename function which handle ~ and environment variable in filenames 2012-01-29 22:24:43 +00:00
Maxime Coste
6fa5d809ef whitespace fix 2011-12-22 13:33:29 +00:00
Maxime Coste
de19aeb035 File: extract read_file function which returns file content in a string 2011-11-27 12:56:38 +00:00
Maxime Coste
9db4aa9691 Buffer: add a type property 2011-10-07 14:15:55 +00:00
Maxime Coste
945426f47a File: fix write_buffer_to_file 2011-10-03 18:40:12 +00:00
Maxime Coste
030c5caf0a assert: custom implementation 2011-09-09 19:24:18 +00:00
Maxime Coste
3caf962110 exception: refactoring 2011-09-09 18:40:59 +00:00
Maxime Coste
3f51feaaef Buffer: accept initial content in constructor 2011-09-06 18:33:18 +00:00
Maxime Coste
11d82b11b3 create_buffer_from_file: throw file_not_found instead of open_file_error when ENOENT 2011-09-02 18:01:20 +00:00
Maxime Coste
535285d9e6 Initial commit 2011-09-02 16:51:20 +00:00