Commit Graph

21 Commits (1e1967308dc191920c1188be8c7eecec3cb76224)

Author SHA1 Message Date
Ryan Russell ae12c58f0f
Improve Readability (#2639) 2 years ago
Blaž Hrastnik 59f05088b9
Optimize rendering by using Ropey::byte_slice
This avoids costly conversions via byte_to_char (which are then
reversed back into bytes internally in Ropey).

Reduces time spent in slice/byte_to_char from ~24% to ~5%.
3 years ago
Blaž Hrastnik 2302869836 fix: ensure_grapheme_boundary_next_byte needs to index at valid char 3 years ago
Blaž Hrastnik 11c3ba9350 Speed up ensure_next_boundary during render
This code:

    let start = ensure_grapheme_boundary_next(text, text.byte_to_char(start));
    let end = ensure_grapheme_boundary_next(text, text.byte_to_char(end));

Would convert byte to char index, but then internally immediately convert back
to byte index, operate on it, then convert it to char index.

This change reduces the amount of time spent in ensure_grapheme_boundary from
29% to 2%.
3 years ago
Omnikar 45fadf6151
Add hyperlinks to fix `cargo doc` warn (#931) 3 years ago
Kirawi 92c2d5d3bf
Document more of helix-core (#904) 3 years ago
Nathan Vegdahl 77a266e818 Better validation method APIs for `Range`.
This way they do less work, are more specific to what we actually
need, and they compose.
3 years ago
Nathan Vegdahl d07074740b Add `Range` methods for various kinds of validation. 3 years ago
Nathan Vegdahl a6cadddef4 Fix silly mistake in previous phantom line bug fix.
Fixes #381.  I was trying to change an index value that... wasn't
even an index value.
3 years ago
Nathan Vegdahl 2dba228c76 Fix highlight code splitting graphemes.
This resulted in phantom blank lines in files with CRLF line
endings, but could potentially have manifested with other
graphemes as well.
3 years ago
Nathan Vegdahl 9cbf564d08 Handle erroneously ignored case in RopeGraphemes iterator. 3 years ago
notoria 1b14e9a19a Downgrade `unicode-segmentation` 3 years ago
Ivan Tham 7cc13fefe9 Derive debug without feature
Note that this also removed those `finish_non_exhaustive()`.
3 years ago
notoria 1a3a924634 Implement Debug for data structure as a feature 3 years ago
Blaž Hrastnik 06aca7691c clippy lint 4 years ago
Blaž Hrastnik ad58286dc7 graphemes: fix nth_prev_grapheme_boundary calculation. 4 years ago
Blaž Hrastnik 6bd16a7320 graphemes: Optimize nth_next/nth_prev operation.
It's used a lot more than it used to in position calculation. Instead of
throwing away state between boundary calculation, reuse it.
4 years ago
Blaž Hrastnik 4ab5631d65 more lints 4 years ago
Blaž Hrastnik c9dd1c930e treewide: &RopeSlice -> RopeSlice. It's Copy so no reason to pass by ref 4 years ago
Blaž Hrastnik 3848058472 clippy lint 5 years ago
Blaž Hrastnik 613d06dfb0 wip: importing to github 5 years ago