cargo-spellcheck icon indicating copy to clipboard operation
cargo-spellcheck copied to clipboard

`find_spans()` of `CheckableChunk` only checks for linefeed as newline.

Open KuabeM opened this issue 4 years ago • 6 comments

Describe the bug

Method find_spans() in chunk.rs only recgonizes a linefeed as newlines, but should also acknowledge CRLF and friends. See FIXME in chunk.rs:219.

To Reproduce

Steps to reproduce the behaviour:

  1. A file containing \r\n as newline
  2. Run cargo spellcheck on that file
  3. find_spans() will be broken

Expected behavior

Everything works on files with \r\n as expected.

Please complete the following information:**

  • System: Arch Linux
  • Obtained: git
  • Version: cargo-spellcheck 0.4.7-alpha.0

KuabeM avatar Nov 09 '20 20:11 KuabeM

I'm investigating this in branch korbinian-fix-find-spans, I've just pushed a first guess (which isn't working :disappointed:) plus a unit test. I'll open a PR if I found a proper solution.

KuabeM avatar Dec 23 '20 22:12 KuabeM

Ping :upside_down_face:

drahnr avatar Apr 19 '21 08:04 drahnr

Hopsa, I guess I should have a look again :D thanks for the reminder!

KuabeM avatar Apr 19 '21 11:04 KuabeM

No worries, also #137 ;) - might be easier to do it at all at once

drahnr avatar Apr 19 '21 14:04 drahnr

Any roadblocks I could help with?

drahnr avatar May 06 '21 06:05 drahnr

Nope, just me not having enough time. As you suggested I'm actually doing #137. It makes more sense to rewrite the whole thing

KuabeM avatar May 07 '21 08:05 KuabeM