-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestions for API additions #6
Comments
Thanks!
The B-tree's invariants are also identical, except in crop CRLFs can be split across chunks. complex iterators: I could be open to add something like a
|
Hello
Thank you! |
|
CharIndicies would be nice, given this is what we are left to support Nom: https://doc.rust-lang.org/beta/core/str/struct.CharIndices.html |
@stevefan1999-personal what is the use case for |
I'm trying to implement nom traits for crop but I guess I will try around it |
Author of Ropey here. I just want to chime in about a couple of things. @noib3 wrote:
Even in Ropey, In particular, both of those methods are opaque, which means (among other things):
So I think it's perfectly sensible for crop to not support these methods.
This one actually is useful. There are various situations where if it is a contiguous string you can do something more efficient, and otherwise you fall back to less efficient code that doesn't rely on it being contiguous. This especially comes up in rendering/shaping code.
Having said that, both of these can essentially be implemented by client code (though perhaps slightly less efficiently). So it's certainly not a critical API. But unlike certain other APIs in Ropey, I actually do think these two have really pulled their weight. |
Can we get non-panicking variants of the functions? |
What about replace with other ropes without having to turn it into a string, i.e. rope merge? |
Yes, there's a PR open for it that I've yet to review, but I'm open to the idea.
Probably not, like
You don't have to allocate to do this, you can call |
@noib3 but what is a chunk? I need to know this because I'm implementing a preprocessor and I have some |
Hello sir,
Good job on
crop
!I was considering using it in my toy editor, however I found out looking around in the API that some things I like in
ropey
are missing here:Rope::is_instance
Rope::from_reader
andRope::write_to
RopeSlice::as_str
andFrom<RopeSlice> for Cow<str>
design.md
Things not in
ropey
I'd love to use:Chunks
) with offsets (see this)byte
<->(line, col)
(see this)What are your thoughts about those API additions? Would you be open to PRs?
Thanks
The text was updated successfully, but these errors were encountered: