257ce5c1fe
Move view position and cursors into a new EditorState struct.
2025-04-13 12:40:16 +02:00
31d468928c
Use Ropey 2 alpha release on crates.io.
...
Also update other dependencies.
2024-10-21 06:39:59 +02:00
2e04233c79
Rename Transaction
-> Change
.
2024-10-19 08:57:19 +02:00
5ad3f0ce8c
Use emacs-style undo.
...
Rather than truncating the undo stack when making an edit after undoing,
the undo steps themselves are pushed onto the undo stack before the
edit. This means that the undo stack never loses any previous states
of the document, and those states are always accessible by just undoing
enough.
2024-10-04 20:42:15 +02:00
22d9f4f660
Update code for Ropey 2 method rename.
2024-06-08 16:51:27 +02:00
cd2314905a
Port to Ropey 2.0-alpha.
2024-06-08 07:58:58 +02:00
9087019542
Implement applying transactions to mark sets.
2023-10-24 23:35:15 +02:00
fa55afeebe
Start moving editor over to using transactions.
...
Also switch from LedHash to TentHash.
2023-10-23 19:18:02 +02:00
03cfb01942
Simplify one of the cases in transaction composition.
2023-10-23 18:54:04 +02:00
f8ba027c38
Hash: use optimized rotation constants.
...
Also use random constants for the initial hash state. Changed my
mind about using zero initialization. It doesn't make a practical
difference, but helps esnure that the mixing is randomized.
2022-09-03 20:59:10 -07:00
776438e866
Hash: convert to hex string in a simpler way.
2022-09-02 21:59:34 -07:00
e81beb733e
Add one more test for the hash.
2022-08-29 19:16:58 -07:00
c585e38a54
Hash: start with a state of zero.
...
This doesn't affect the quality of the hash at all, and an empty
message hashing to zero is kind of nice.
2022-08-29 18:47:31 -07:00
03e78299c6
Use hash perf leeway from prior commits to make the hash higher quality.
...
When incorporating a data block into the hash, it now does enough
mixing rounds to flip on average about 110 bits for any bit flipped
by the data block.
This reduces performance again, but not all the way to what they
were before. It's still reasonably fast, hashing at around 6-7 GB/s.
2022-08-25 23:54:03 -07:00
e25e28d88b
Slightly easier-to-modify hash code.
2022-08-25 19:56:38 -07:00
7d7ab1acf1
Significant speed up to the hash.
...
It can now hash data at 9-10 GiB/s.
2022-08-25 16:27:43 -07:00
a41e1dd7de
Add benchmarks for LedHash256, and tweak for performance.
...
Also benchmark against Blake3.
2022-08-24 18:45:36 -07:00
3f3cf5dd3a
Switch other backend code over to use transactions.
2022-08-23 12:30:14 -07:00
696ecb732d
Implemented Transaction composition.
2022-08-22 21:10:28 -07:00
19fa7b6abe
Start implementing transaction composition.
2022-03-26 06:04:17 -07:00
f3c12d6cee
More work on Transaction.
2021-11-14 14:33:52 -08:00
f9415d915f
Merge branch 'master' of github.com:cessen/led
2021-11-14 11:36:16 -08:00
51a86dcfdc
Beginnings of a Transaction type.
2021-11-14 11:35:25 -08:00
88c7ded976
Update dependencies to latest versions.
2021-06-16 11:27:47 -07:00
27572c8838
More code cleanup of the hash.
2020-02-24 13:31:17 +09:00
4e435732d7
Cleaned up the hash implementation a bit.
2020-02-24 13:09:49 +09:00
dc9b3dd5c3
Removed all but one unsafe call from the hasher.
2020-02-24 12:50:18 +09:00
c38c83a8b5
Reduced the set of tests for the hash function.
...
Also added a couple new ones to test possible edge cases.
2020-02-24 12:33:36 +09:00
e810503e56
Slight tweak to the hash function.
...
The last swap isn't actually needed, and this makes the implementation
cleaner for different numbers of rounds if we want to tweak that
later.
2020-02-24 10:18:58 +09:00
905ff2c301
Cleaned up the hash implementation and made it endian-clean.
2020-02-24 10:09:13 +09:00
e1d91ff43d
Move filepath into the Buffer struct.
2020-02-24 07:35:04 +09:00
4544efb299
Undo/redo wasn't marking the buffer as dirty. Fixed.
2020-02-23 20:14:13 +09:00
4a33750a6b
Fix minor bug from the move to the new buffer.
2020-02-23 20:10:30 +09:00
c4fa72405f
Switch to new backend buffer for text, cursor, and undo management.
2020-02-23 19:56:08 +09:00
6077be2dfd
Add convenience fn's and impls for iterating and indexing MarkSets.
2020-02-23 16:24:41 +09:00
4267334303
Finish the bare-bones undo/redo system.
2020-02-23 15:37:16 +09:00
0c887d1eb9
Beginnings of an undo system for the new backend.
...
Just going to keep it stupid and simple for now. More
sophisticated undo functionality can be added in the future.
2020-02-22 18:00:28 +09:00
c3bfdf7a7f
Add Mark
and MarkSet
types for managing cursors etc.
...
Originally I was using just `(usize, usize)` for marks, and `Vec`s
of those for sets. But that was already becoming unwieldy even for
really basic code. This abstracts just a handful of common
operations away to make this easier to reason about. However,
the internals are (intentionally) left exposed to allow other fiddly
things to be done.
2020-02-11 11:35:31 +09:00
fb1996c21a
Have buffers store marks ranges.
...
This is very WIP. The intent is for these to be used for e.g.
cursors, screen positions, etc. The intent is for the buffer
itself to keep them synced properly with the actual text on edits,
although this is not yet implemented.
2020-02-01 11:17:08 +09:00
f94fc0408f
Updated most dependencies to latest version.
...
Holding off on smallvec since there's an API break.
2020-01-23 18:57:34 +09:00
dab1c9ed1b
Updated to Rust 2018.
...
No functional changes.
2020-01-23 18:47:27 +09:00
f0a44ab300
More work on the backend, including adding data hashing code.
2020-01-22 10:17:56 +09:00
540803e0ee
Update dependencies.
2019-09-01 11:40:02 +09:00
6f4e619263
Update dependencies, including Ropey -> 1.0.
2019-01-06 17:38:44 -08:00
a843aee904
Split text_encoding off into its own repo.
...
It's more generally useful, and I was working with it as its own
crate anyway.
2018-08-23 13:33:14 -07:00
30a1440399
Tests for single-byte encodings, and related bug fixes.
2018-08-23 13:21:16 -07:00
3d8eaefa6b
Added a lot of single-byte text encodings to text_encoding sub-crate.
...
They are largely auto-generated from text-based tables from the
WHATWG encoding standard. Most of them are still not available
in the code itself, but they are generating correctly, and exposing
them is just a matter of boiler plate.
2018-08-23 02:29:58 -07:00
3203da38bd
Added unit tests for windows1252 encoding/decoding.
2018-08-22 19:00:47 -07:00
fb95ff36c1
Added unit tests for latin1 encoding/decoding.
2018-08-22 18:17:05 -07:00
9409bfe7fb
Tests for utf8 encoding/decoding, and improved utf8 errors.
2018-08-22 17:53:07 -07:00