Commit Graph

105 Commits

Author SHA1 Message Date
Maxime Coste
475e8849a1 Fix replacing last eol with a single eol 2017-06-26 16:16:46 +01:00
Maxime Coste
7bcfbd055c Fix corner case in compute_modified_ranges 2017-06-11 12:25:12 +01:00
Maxime Coste
63a791d651 Fix the Buffer::end() madness
Until now, buffer had multiple recognized end coordinates, either
{ line_count, 0 } or { line_count - 1, line[line_count - 1].length }.

Now the only correct end coord is { line_count, 0 }, removing the need
for various special cases.
2017-06-11 12:01:40 +01:00
Maxime Coste
d9b1ee13d9 Change merge_overlapping to guarantee we dont break the sorting
In certain cases, we could end up with a unsorted selection list,
leading to broken invariant.
2017-06-07 19:30:44 +01:00
Maxime Coste
a88e58763b Move SelectionList::set implementation out of the header 2017-03-15 16:51:55 +00:00
Maxime Coste
6759511b9e Ensure main selection index is correct directly in SelectionList::remove 2017-03-03 20:17:11 +00:00
Maxime Coste
e7e72747ed Update ranges highlighter options according to buffer changes 2017-01-13 13:52:55 +00:00
Maxime Coste
dcd8f6ef01 Apply clang-tidy modernize to the codebase 2017-01-08 22:39:01 +00:00
Maxime Coste
cd89531bd9 Better handling of linewise inserting when we have multiple selections per line
Fixes #1053
2017-01-01 18:08:43 +00:00
Maxime Coste
cdb2c766a5 Refactor SelectionList::insert a bit 2017-01-01 17:31:47 +00:00
Maxime Coste
780a4605fa More transform(...) filter cleanup using mem_fn when possible 2016-10-11 00:32:40 +01:00
Maxime Coste
35559b65dd Support codepoints of variable width
Add a ColumnCount type and use it in place of CharCount whenever
more appropriate, take column size of codepoints into account for
vertical movements and docstring wrapping.

Fixes #811
2016-10-01 13:45:00 +01:00
Maxime Coste
b934bcd4e1 Support merging consecutive selections with <a-m>
Fixes #773
2016-08-27 11:20:38 +01:00
Maxime Coste
8cc27354e8 Support sorting and merging overlapping separately, fix bug in move
Fixes #754
2016-07-30 15:32:47 +01:00
Maxime Coste
80c3405a20 Rework SelectionList::check_invariant 2016-07-27 00:04:06 +01:00
Maxime Coste
13ed87410f Rework compute_modified_ranges
Fixes #743
2016-07-26 23:31:23 +01:00
Maxime Coste
b988871df6 Ensure selections are sorted and non overlapping in selections_list_from_string 2016-07-14 21:14:17 +01:00
Maxime Coste
52d3b60aaa Clamp selection generated in selection_list_from_string
Fixes #733
2016-07-13 19:25:32 +01:00
Maxime Coste
88a9607552 Keep modified selections in non-draft exec/eval -itersel
Fixes #727
2016-07-08 09:52:10 +01:00
Maxime Coste
e2bfd9e3b2 Diagnose empty selection desc string
Fixes #690
2016-06-06 17:17:18 +01:00
Maxime Coste
b0060ed79e Fix modified range computation when erasing multiple times past current buffer end
Fixes #654
2016-04-13 21:21:00 +01:00
Maxime Coste
d3ef2d36ea Add a SplitView container view 2016-03-25 20:38:26 +00:00
Maxime Coste
131b0a8298 Use ByteCoords directly for buffer insert/erase/replace 2016-03-16 13:59:30 +00:00
Maxime Coste
de1433d30a Avoid the spurious newline insertion when replacing at end of buffer
Add a Buffer::replace method to handle the replacements properly
Fixes #633
2016-03-16 13:48:11 +00:00
Maxime Coste
9e15181dc9 Rework container helpers, use pipe syntax and cleanup implementation
use 'container | filter(func) | reverse() | transform(func)' instead
of 'transform(reverse(filter(container), func), func)' to express
container transformations.
2016-03-08 21:35:56 +00:00
Maxime Coste
24411569fc Slight refactor in selection update code 2015-12-17 04:56:44 +00:00
Maxime Coste
d6a2d77857 Fix double check_invariant in SelectionList construction, and set main selection to last 2015-11-04 19:53:47 +00:00
Maxime Coste
27571a7716 Refactor utf8::iterator to be on the safe side
utf8::iterator now knows the iterator valid range, and pass
it to utf8 functions.
2015-09-23 19:39:21 +01:00
Maxime Coste
d19df5d5de Enable more invariant checking in selection lists 2015-08-03 11:23:40 +01:00
Maxime Coste
6f337b254d Fix warning 2015-07-24 13:57:44 +01:00
Maxime Coste
8795a56731 Merge overlapping selections before erasing
Overlapping selections on erase confuse the ForwardChangeTracker
and will confuse the user,

Fixes #298
2015-06-28 10:16:39 +01:00
Maxime Coste
e1ba2991f5 Initial selection saving/restoring support bound to ^ and alt-^ 2015-06-27 11:02:08 +01:00
Maxime Coste
87fcfda508 Avoid buffer end in compute_modified_ranges 2015-06-05 13:10:30 +01:00
Maxime Coste
c38a7f3ca4 Merge branch 'diff' 2015-05-21 22:58:50 +01:00
Maxime Coste
43f7657151 Remove clamping in compute_modified_range
It can result in a non ordered range list.
2015-05-20 13:34:16 +01:00
Maxime Coste
f224d11ccd Small cleanup in selections.cc 2015-05-13 23:22:48 +01:00
Maxime Coste
8ff63198bc Comment out update_erase function (keeped for reference)
Fixes #254
2015-04-21 13:51:01 +01:00
Maxime Coste
eb9c95298e Add support for string <-> selection list serialization 2015-04-13 15:21:26 +01:00
Maxime Coste
1cec8df45e ArrayView content is not const anymore
As in upcoming std c++ array_view, ArrayView<T> points to mutable
data, use ArrayView<const T> or alias ConstArrayView<T> for const
data.
2015-03-09 13:54:09 +00:00
Maxime Coste
56dd5f9540 Fix selecting of insert text in SelectionList::insert 2015-02-09 21:09:17 +00:00
Maxime Coste
f4e96e7f2e Fix bug when deleting end of buffer text using multiple selections 2015-01-23 19:12:15 +00:00
Maxime Coste
da562e03a0 replace all std::vector with Vector 2015-01-12 13:58:41 +00:00
Maxime Coste
295a97f2a6 Rename memoryview to ArrayView 2015-01-06 13:43:37 +00:00
Maxime Coste
116ea7364a Restore some special behaviours, I missed them in interactive mode. 2014-12-19 13:58:33 +00:00
Maxime Coste
fc4d77964e Remove special case when appending at eol 2014-12-13 13:10:40 +00:00
Maxime Coste
b6f2b872b0 Preserve selection orientation when replacing
Fixes #31
2014-10-12 18:58:10 +01:00
Maxime Coste
d4a84125ef Use InternedStrings for buffer contents 2014-10-03 13:39:13 +01:00
Maxime Coste
0ac65e1610 Use std:move for selection parameters 2014-09-22 13:55:39 +01:00
Maxime Coste
6813440212 Fix Selection::insert when replacing with empty string at the end of the buffer 2014-07-25 23:47:11 +01:00
Maxime Coste
d181a40a91 Add support for paste all (on <a-[pP]>)
Paste all pastes all yanked text at all selections, selecting each
pasted text.

Replace paste moves to R, and concat yank/concat delete (Y and D)
are removed.

Fixes #161
2014-07-05 12:10:06 +01:00