-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Line ending detection #224
Conversation
c2693db
to
ec4b7c6
Compare
@archseer I started replacing some occurances of '\n' in commands.rs. I noticed that a lot of places take in '\n' as a char, not a &str. But doc.line_ending() returns a &str, because (as much as I understand) "\r\n" is 2 characters long. Any ideas what to do here? Also I can't call doc.line_ending() at some points because doc can't be instantiated there yet because of lifetime errors. |
Any place that needs a line ending as a literal should take a Something else that occurred to me is we could have |
856fd95
to
9c3eadb
Compare
To anyone watching: I got permission to take this PR over, so I'll be finishing this up. |
Also some general cleanup and some minor fixes along the way.
…ng_detection Rebasing was making me manually fix conflicts on every commit, so merging instead.
It's plain-old-data. If we want to do fancier things later, it's easy to switch back.
This is needed in some places.
…\n', as this fixes CRLF files not rendering properly. Code that inserts line endings still needs to be changed and a platform default line ending could be added.
@archseer may I ask why slice here isn't a borrow like in the original code?
Fixes #118
Fixes #68