Commit Graph

97 Commits

Author SHA1 Message Date
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
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
ce17aa6a62 Added a copyright license. 2015-01-21 20:41:01 -08:00
ecb5fbc98e Updated todo and readme files. 2015-01-21 20:37:53 -08:00
97b2f18870 Source Code Pro is now embedded in the executable as the default font. 2015-01-21 20:21:34 -08:00
b4e0a2e234 Cleaned up GUI rendering code a bit. 2015-01-21 20:13:20 -08:00
ea6d1c56d1 A feeble attempt to overcome flickering issues on window resize.
It really seems insurmountable at this point.  Not sure what SDL is doing
that's causing this.  But I'm leaving this code in, because it makes
things a little cleaner and serves as a good example to myself for how
to render to textures.
2015-01-20 21:55:11 -08:00
6c6e8896a1 GUI actually displays the text of the loaded buffer now. Woo hoo!
To make this performant, the Font struct caches rendered glyphs as
sdl textures.  Without caching, performance is abysmal.
2015-01-19 22:47:43 -08:00
463911e5b3 Beginnings of a GUI. 2015-01-18 22:52:35 -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
30ad0c2ea4 Added SDL2 and Freetype as dependencies, in preparation for a GUI.
Also wrapped Freetype functionality in a Font struct.
2015-01-18 13:12:01 -08:00
e726b2d0f8 Fixed some bugs in new multi-cursor code. 2015-01-13 00:15:26 -08:00
9a22812cf1 First steps towards multiple cursor support. 2015-01-13 00:03:16 -08:00
fc194bef09 Updated todo file. 2015-01-11 12:39:41 -08:00
d80586e262 Fixed bug in cursor movement code that would result in crashes. 2015-01-11 11:36:34 -08:00
9156f5cf47 Passing a filename that doesn't exist will now open a buffer that will be saved to a new file of that name. 2015-01-11 01:25:23 -08:00
d6e28b02a3 Fixed some warnings. 2015-01-11 01:16:21 -08:00
d02459f647 Undo/redo should mark buffer as dirty. 2015-01-11 01:04:24 -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
b31903e838 Updated todo file. 2015-01-11 00:30:58 -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
1ca7885105 Updated todo file. 2015-01-09 23:16:00 -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
f760d6078d Added jump-to-line functionality and fixed some display bugs. 2015-01-03 13:09:12 -08:00
a85a3bf8fa Added status/info line at top of terminal UI. 2015-01-02 17:41:08 -08:00
250a1f94ef Implemented delete key. 2015-01-02 16:52:29 -08:00
940068a4dd Fixed some bugs relating to text and cursor printing. 2015-01-02 16:47:17 -08:00