02f24e4e6f
WIP refactor to switch over to Rope from BufferNode.
2015-02-22 11:45:57 -08:00
52cb5f9456
Improved Rope's text insertion performance for large insertion strings.
2015-02-21 11:16:21 -08:00
6eed3fcc74
Improved file load times.
...
There was a regression after switching to ropes. Now it's pretty much
back to pre-rope load times.
2015-02-15 20:15:19 -08:00
e1c9a6955d
Lines now internally use ropes to store their text.
...
The rope uses a large leaf-node text length, so in the vast majority of
cases this ends up being the same as directly storing the string data.
But in the case that the line becomes extremely long, this will allow
for reasonable performance
2015-02-15 14:56:56 -08:00
a89e505fb0
Beginnings of a Rope data structure for strings.
...
This will be used to hold the text of an individual line, for better
long-line handling.
2015-02-14 14:19:46 -08:00
2d50906f43
Moved the rest of file loading/saving into Buffer.
2015-02-07 23:35:25 -08:00
e9462e4400
Silencing some rustc warnings.
2015-02-07 19:55:25 -08:00
26965417f3
WOrking on getting cursor movement working again.
2015-02-07 19:46:08 -08:00
6f2cbe5b87
Basic text buffer drawing is working again.
2015-02-07 00:45:28 -08:00
8319033ae5
First step in pulling formatters out of the text buffer.
...
This commit pulls the formatter out of the text buffer and
puts it in the editor instead. However, there is a lot of
commented code utlizing the buffer and formatter that still
needs to be updated.
In short, the editor is pretty non-functional in this commit.
2015-02-06 19:47:52 -08:00
e29777e33c
Improved file loading.
...
File loading is now the responsibility of the Buffer, which allows
it to do some weird internal stuff to make it faster.
Also, using custom code for scanning the text, so all line endings
are handled now, not just LF and CRLF.
2015-02-01 23:17:43 -08:00
c9d09f6f98
Moved line_ending_type out of Buffer and into Editor.
2015-01-31 15:06:04 -08:00
afa1a8f67c
Fixed nasty bug in reformatting code.
...
It was not actually reformatting things...
2015-01-31 13:41:41 -08:00
7b87db4e41
Line wrapping width is now determined by terminal width.
2015-01-31 13:19:14 -08:00
8701ebbba7
Tweaked code to avoid warnings from latest rustc compiler.
2015-01-29 21:03:56 -08:00
f222cd6a54
Fixed remaining cursor navigation bugs (I think...?).
2015-01-27 23:58:45 -08:00
0557f5f6ce
Reorganized the code a bit, and started updating unit tests.
2015-01-25 13:20:16 -08:00
4caad17e56
Console drawing is almost back up to snuff.
...
Just missing drawing the cursors if it's at the end of the text buffer.
2015-01-24 21:00:30 -08:00
c69ebc240f
WIP: making Buffers so they can be given LineFormatters.
...
A LineFormatter determines how a line of text is visually displayed in
2d space. This allows both the Console and GUI version of the editor
to share the same buffer code whilst still handling the differing ways
in which both handle visual display.
2015-01-24 14:35:49 -08:00
ac784077f0
Split cursor code into separate file.
...
There is now a CursorSet type that handles multiple cursors, and makes
it convenient to maintain the necessary invariants expected by the rest
of the code for multi-cursor editing.
2015-01-18 15:11:49 -08:00
d6e28b02a3
Fixed some warnings.
2015-01-11 01:16:21 -08:00
f56d3f0ad4
Split remove_text() into remove_text_before() and remove_text_after().
...
This is useful so that undo knows where to put the cursor.
2015-01-11 00:59:02 -08:00
dfcf9fc6a5
A simple implementation of move_text.
...
This should probably be replaced by a more efficient implementation in
the future, as this version will be slow and require large allocations
when moving large pieces of text. But let's wait and see if it's a
problem in practice first.
2015-01-11 00:26:39 -08:00
8a51a796ce
Stub and unit tests for a move_text implementation.
2015-01-11 00:16:59 -08:00
f8cf8e620b
Moved tab_width to Buffer, and misc cleanup related to that.
2015-01-10 23:42:59 -08:00
8b1f1b1e96
Renamed and documented the buffer position conversion functions.
2015-01-10 16:34:28 -08:00
6b5b63dba1
Added full undo/redo functionality.
2015-01-10 12:29:58 -08:00
e61149e514
Organized the code in buffer/mode.rs a bit more nicely.
2015-01-10 12:02:29 -08:00
8fd1659292
Better unit test hygiene, and renamed buffer len() to grapheme_count().
2015-01-10 11:48:20 -08:00
6c659a17dc
Switched undo stack to use a linked list instead of a vector.
...
This makes sure there aren't pathological cases where the user has been
typing for a very long time, and the undo stack needs to change capacity.
2015-01-09 22:40:41 -08:00
b837d488a5
Basic undo functionality.
2015-01-09 22:02:32 -08:00
0fb338f05b
Updated code to compile with Rust 1.0 alpha.
2015-01-09 18:50:27 -08:00
2785c3821b
Updated code to compile with the most recent Rust nightly.
2015-01-04 16:29:19 -08:00
ff6c763821
Soft tabs and user-settable tab-widths are now supported.
...
Also, indentation style is automatically detected on file load.
2015-01-04 00:09:34 -08:00
0941339906
Basic line-ending detection when opening files.
...
Buffers now store what line-ending type they consider themselves to be,
and the ui uses that when adding new lines while editing.
2015-01-03 15:15:14 -08:00
940068a4dd
Fixed some bugs relating to text and cursor printing.
2015-01-02 16:47:17 -08:00
fc78fbeb3e
Non-uniform-width characters are now properly handled (modulo bugs).
2015-01-02 15:05:21 -08:00
7099e4d0d3
Sped up file loading and saving.
2015-01-01 13:14:32 -08:00
cb5b79ec9c
Changed editor drawing to use line iterators.
...
This makes the code easier to follow, and will make it easier to
accomodate non-uniform width graphenes later on.
2014-12-31 20:19:12 -08:00
49b34e78d5
Got basic editing functionality up and running again after the refactor.
2014-12-31 18:39:01 -08:00
71913eed31
Got grapheme iterators and 1d/2d position translation working.
2014-12-31 17:55:20 -08:00
95d6d3fd3e
Got remove_text() working.
...
At least, based on the unit tests so far.
2014-12-31 17:05:24 -08:00
28a4da97a7
More WIP remove_text().
2014-12-31 13:15:58 -08:00
0794d5c6ec
WIP remove_text()
2014-12-31 01:20:51 -08:00
f0f6980b6d
Added a bunch more tests for Buffer, and fixed line removal code.
2014-12-31 00:31:42 -08:00
720246142e
WIP refactor: text can now be inserted into empty buffers.
2014-12-30 22:55:23 -08:00
c88ba48b6d
WIP refactor: change text buffer to use the Line struct for storing text.
...
Most of the UI and editor code is either commented out or not included
in the compile right now. This is temporary while I get the basic
text code working again.
2014-12-29 16:17:53 -08:00
370d8a315e
WIP refactor: changing internal text representation to be line-based.
...
This will make some of the internals a little more complex, but should
simplify things on the balance.
2014-12-28 20:53:25 -08:00
74cd79745f
Scrolling in the editor by following the cursor now works.
2014-12-27 13:59:41 -08:00
833e92c5a0
Added a some text manipulation methods, and made backspace work properly.
2014-12-26 21:03:13 -08:00