Commit Graph

134 Commits

Author SHA1 Message Date
311f8aca67 First attempt at making display code really take advantage of long line support.
It's not quite working right, but it does at least prevent performance
degradation.
2015-02-16 22:29:41 -08:00
86f3ada8ea Small tweak to indentation style auto-detection.
Very slightly favor larger indentations, instead of very slight favor
smaller indentations.  This is more likely to do the right thing on
very small files.
2015-02-16 22:06:48 -08:00
d3cbc7644f Updates for latest rustc. 2015-02-16 22:01:22 -08:00
0bc809781d WIP: fixes for long line support. 2015-02-15 23:23:17 -08:00
ecf91607ac WIP long line support.
Got index_offset_vertical_v2d() partially working.  Still seems to be a tad
buggy, though.
2015-02-15 23:09:13 -08:00
a1d636a4d8 WIP: handling extremely long lines with good performance.
The formatters now work on grapheme iterators instead of directly on
lines, which frees up the LineFormatter to break up long lines into
smaller blocks of text.  This is partially taken advantage of right
now in various parts of the code, but more work is still needed to
get it both working properly and fast.
2015-02-15 22:41:11 -08:00
f4a70ba1ad Made screen drawing a tad faster for long lines.
In preparation for much more major speed-ups with long lines.
2015-02-15 20:35:17 -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
de58f01b2f Added some benchmarks for Rope, and improved new_from_str() for Rope.
The new new_from_str() uses an algorithm that should be linear time
complexity compared to the length of the string.
2015-02-15 19:42:07 -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
902d93e957 Line numbers are now displayed in left-hand gutter. 2015-02-08 19:17:48 -08:00
9b24b2b4f2 Added rust-encoding as a dependency, in prep for text encoding support. 2015-02-08 00:19:37 -08:00
ed888939bf Updated todo file. 2015-02-07 23:38:32 -08:00
2d50906f43 Moved the rest of file loading/saving into Buffer. 2015-02-07 23:35:25 -08:00
8a077bf4d0 Updated todo file. 2015-02-07 23:27:38 -08:00
8d76e3fb17 View scrolling seems to work properly now. 2015-02-07 23:14:56 -08:00
8f94b32953 Have view scrolling nearly working again.
Just doesn't *quite* work with wrapped lines.  Need to investigate.
2015-02-07 22:57:25 -08:00
870818fec8 Cursor movement appears to be working properly again. 2015-02-07 22:07:48 -08:00
27959dadf8 WIP fixing cursor movement code. 2015-02-07 21:38:16 -08:00
6fc2f34053 Finished converting the term_ui drawing code over to the new formatting code. 2015-02-07 21:37:11 -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
e9c06615f9 Silenced some compiler warnings. 2015-02-07 00:52:52 -08:00
6f2cbe5b87 Basic text buffer drawing is working again. 2015-02-07 00:45:28 -08:00
3ae51f7f7e Formatters are now primarily factories for iterators.
This is a big shift in the formatter API's.  It simplifies the
responsibilities of the implementers so that pretty much all they
have to do it implement an iterator.  Everything else will be
automatically derived from that.  (Or, at least, that's the hope.)
2015-02-06 23:58:19 -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
643db93939 Updated todo file. 2015-02-01 17:23:35 -08:00
4d114162ee Improved window resizing responsiveness.
The reformat code was being run on every resize event,
which chokes on most resizes which end up emitting a lot
of resize events.  Now it waits and processes a bunch of
resize events until there aren't any left, and only does
the actual reformat on the last one.
2015-02-01 13:50:47 -08:00
c9d09f6f98 Moved line_ending_type out of Buffer and into Editor. 2015-01-31 15:06:04 -08:00
67e4495d83 Minor tweak to console formatting code.
Made it so that the line-height can be easily changed in one
place, for experimentation.
2015-01-31 13:53:07 -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
c6cfebdb75 Commented out the GUI modules until I can figure out how to get it working again.
The rust SDL2 bindings have changed in a way that makes the lifetimes
very strict.  This is probably a good thing from a safety standpoint,
but means I'll likely need to re-architect the GUI drawing code.

For now I'm going to leave that on the back-burner and focus on getting
the console version working.
2015-01-29 20:35:19 -08:00
5652b62fc8 Misc code cleanup. 2015-01-28 00:09:07 -08:00
f222cd6a54 Fixed remaining cursor navigation bugs (I think...?). 2015-01-27 23:58:45 -08:00
bde11e6c7b Spoke too soon... still bugs in cursor nav. This fixes one of them. 2015-01-27 22:57:50 -08:00
40bf2460a9 Fixed line wrapping cursor nav. 2015-01-27 22:44:01 -08:00
04816ebe84 Beginnings of line wrapping for terminal ui. 2015-01-26 22:55:47 -08:00
413306f814 Updated todo file. 2015-01-25 22:32:36 -08:00
83fa6a72cb Tabs working again. 2015-01-25 22:07:06 -08:00
109e46a027 WIP: moving GUI code over to use LineFormatter. 2015-01-25 14:00:45 -08:00
8d83fe77d2 Re-enabled the GUI code. 2015-01-25 13:30:15 -08:00
352e5370ce Fully updated unit tests. All passing again. 2015-01-25 13:28:04 -08:00
0557f5f6ce Reorganized the code a bit, and started updating unit tests. 2015-01-25 13:20:16 -08:00
518b9a7e42 Console editor appears to be back up to snuff again! 2015-01-24 21:38:13 -08:00
a69f89d238 Fixed bug in v2d_to_index code that was causing cursor nav issues. 2015-01-24 21:15:32 -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