Closed crowlKats closed 2 years ago
Ropey is intended to be lower level than that, and (intentionally) doesn't provide higher-level editing commands. The intention is that client code builds their own higher-level editing commands from the lower level methods provided by Ropey.
Having said that, I do think a function for getting the char
index range of a line's line-ending might make sense. And that would make it trivial to do what you're asking: just query for the line-ending range, and then pass that to remove()
.
Ropey is intended to be lower level than that, and (intentionally) doesn't provide higher-level editing commands. The intention is that client code builds their own higher-level editing commands from the lower level methods provided by Ropey.
True, forgot that for a moment
Having said that, I do think a function for getting the
char
index range of a line's line-ending might make sense. And that would make it trivial to do what you're asking: just query for the line-ending range, and then pass that toremove()
.
that sounds perfect!
So, I've been sitting on this for a while. And that's mostly because I keep flipping back and forth between thinking this is a good idea or not.
And I think that's probably a sign that it doesn't, in fact, belong in Ropey. Thankfully, the code to implement it yourself is pretty straightforward.
It would be great if there was a simple way to remove the newline between two lines, turning it into one line