Skip to content

Commit

Permalink
Bad fix for newline problem
Browse files Browse the repository at this point in the history
  • Loading branch information
zesterer committed Nov 23, 2021
1 parent e3cb394 commit c2b5e34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [zesterer]
4 changes: 2 additions & 2 deletions src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ impl<S: AsRef<str>> From<S> for Source {
Self {
lines: s
.as_ref()
.lines()
.split_terminator('\n') // TODO: Handle non-\n newlines
.map(|line| {
let l = Line {
offset,
len: line.chars().count() + 1, // TODO: Don't assume all newlines are a single character!
len: line.chars().count() + 1,
chars: line.trim_end().to_owned(),
};
offset += l.len;
Expand Down

0 comments on commit c2b5e34

Please sign in to comment.