9512018983
Implemented indentation for soft-wrapped lines again.
2020-02-13 19:29:23 +09:00
7b652c98da
Remove options for char wrap and non-wrapping. Always word-wrap.
2020-02-11 21:12:22 +09:00
f117fda29e
Cleaning up a bunch of old unused code.
2020-02-11 20:54:41 +09:00
19adb08170
Reworking the text formatting code.
...
It's a mess of indirection and over-abstraction, and this commit
is the first step at cleaning that up. In addition to making the
code easier to follow, it's also notably faster.
The only downside is we've (temporarily) lost indentation
continuation on line wrapping. But that can be added back without
too much trouble later.
2020-02-11 20:24:34 +09:00
6e8f132563
Don't visually freeze the UI on an onslaught of input.
2020-02-11 08:33:22 +09:00
d1de3aacb3
More efficient line block boundary finding.
2020-02-06 19:18:50 +09:00
f95cb7f641
Use saturating_sub() method instead of adhoc equivalent.
2020-02-06 18:19:50 +09:00
f582818387
Set the cursor position appropriately.
...
This makes international input popups get placed correctly for
terminals that do that.
2020-02-04 20:54:38 +09:00
0b8c590dea
More concise implementation of stderr capture.
2020-02-02 17:36:11 +09:00
dd40937cfa
Capture stderr output so that it can be printed after exit.
...
Otherwise is was just getting swallowed in the alternate terminal
buffer. This was especially annoying with panics, since their
messages and backtraces got completely swallowed.
2020-02-02 17:20:00 +09:00
8a49ed74c5
Fix bug in how vertical and horizontal offsets are calculated.
2020-02-02 00:14:08 +09:00
4e1bdc412c
Better white-space-favoring chunk-splitting behavior.
2020-02-01 23:06:15 +09:00
db0ce6a4f6
Bug fix + remove a debug print I accidentally left in.
2020-02-01 22:43:06 +09:00
ebfedab58c
Change how line chunking works, to favor breaking on whitespace.
2020-02-01 22:32:09 +09:00
18920d9e87
Slightly wider and darker gutter.
2020-02-01 18:12:06 +09:00
9ff24353b4
More color theme tweaks.
2020-02-01 17:56:24 +09:00
14adcf99cb
Nicer color theme.
2020-02-01 15:46:51 +09:00
e6a7d26dbd
Some minor code cleanups and fixes.
2020-01-25 04:28:00 +09:00
f3c59558bb
Added some code comments.
2020-01-25 04:18:23 +09:00
9ace1ecb68
Moved from termion to crossterm for terminal handling.
...
This should (hopefully) make led work on Windows now. Although
I don't have a Windows box to test on.
This also fixes a bug where control codes were ocassionally split
on input, resulting in e.g. a pg-down resulting in control
characters inserted into the buffer.
2020-01-25 04:07:56 +09:00
a867892183
Replaced docopt with clap for command line argument parsing.
2020-01-24 18:32:42 +09:00
bdbd9bce21
Make tests compile again after updating to Rust 2018.
2020-01-23 19:04:45 +09:00
dab1c9ed1b
Updated to Rust 2018.
...
No functional changes.
2020-01-23 18:47:27 +09:00
9cadb9bd8c
Run rustfmt and replace depricated try!() macro with ? operator.
...
No functional changes.
2020-01-22 10:20:29 +09:00
2f5adfad75
Run rustfmt. No functional changes.
2018-08-17 20:36:24 -07:00
b713b72e72
Updating for latest Ropey master.
2018-08-10 16:08:11 -07:00
75742c7aa4
Fixed bug with gutter size not updating as line numbers get wider.
2018-07-20 01:31:56 -07:00
bba508a814
Forgot to run rustfmt.
2018-07-14 01:32:58 -07:00
a3d98a59fb
Updated to lastest master Ropey.
2018-07-14 01:32:24 -07:00
868aa3363f
Updated some code for Ropey API changes.
2018-07-05 20:13:00 -07:00
f8a38111d4
Some nice performance improvements with a simple optimization.
...
We're now very close to being back to the performance levels
we were at before the new Ropey without built-in grapheme
support.
2018-07-05 18:43:17 -07:00
9348a9a916
Another small optimization.
2018-07-05 05:01:57 -07:00
b19997b975
Did some basic optimizations that made things fast again. Yay!
...
The basis for the optimizations were some less basic changes made
in Ropey.
2018-07-05 04:41:58 -07:00
5ca0f5e406
Fomatted with recent rustfmt. No actual code changes.
2018-07-05 02:00:10 -07:00
de625e71dc
Updated to ropey git master, and got everything working again.
...
However, everything is very, very slow now.
2018-07-05 01:53:17 -07:00
16f2aab223
Updated to latest Ropey.
2018-01-11 02:05:00 -08:00
3f2dbf2c13
Fixed tiny bug in view scrolling behavior.
2018-01-01 15:22:28 -08:00
066f0b03cf
Indentation detection can now detect arbitrary space counts.
...
It was using a fixed-size array before, but now is using a
HashMap. This is technically slower, but it's such a negligible
part of the runtime to begin with that it doesn't matter.
2018-01-01 15:01:19 -08:00
020827806b
Use iterator methods to make auto-detect code a little cleaner.
...
Also use chars instead of graphemes for indent detection code.
Graphemes are slower, and don't provide any benefit there.
2018-01-01 14:06:17 -08:00
7121469cba
Termninal size information wasn't being set properly at startup.
2018-01-01 13:38:51 -08:00
54a16c6383
Fixed bug with word wrapping when a word is longer than a line.
2018-01-01 13:25:06 -08:00
dbb640b330
Fixed a couple of bugs that crashed at tiny terminal sizes.
2018-01-01 12:59:47 -08:00
86ca5f9edf
Another silly bug...
2018-01-01 03:21:27 -08:00
cfcc9ab273
Silly bug due to forgetting to change a line of code.
2018-01-01 03:20:10 -08:00
2591aef6d4
Simplified the screen buffer writing.
...
Turns out the main reason it was so slow was because stdout isn't
buffered in Rust by default. That actually makes a lot of sense,
but I'd forgotten.
Wrapping it in a BufWriter solves the performance issues much more
gracefully.
2018-01-01 03:10:32 -08:00
1f62eb32a0
Fixed a bug where very narrow terminal sizes would crash the editor.
2018-01-01 02:37:33 -08:00
1bb93aae00
Got interactive responsiveness to terminal resizing working.
2018-01-01 02:30:11 -08:00
c91f1801ad
Fixed bug in screen buffer display code.
...
This both more correct and faster at the same time. Yay!
2018-01-01 01:27:37 -08:00
17beb9c06d
Using a smallstring implementation inside the screen buffer.
...
This keeps things contiguous in memory in the common case.
2017-12-31 20:05:00 -08:00
0a309fab1a
Made the screen buffer implemention way faster.
...
It's in a pretty good place now, I think. Although its memory
usage could be improved with a small string type.
2017-12-31 19:40:45 -08:00