Skip to content

Commit

Permalink
fix crlf column reset
Browse files Browse the repository at this point in the history
  • Loading branch information
GoNZooo committed Feb 16, 2021
1 parent d3de873 commit 0adfa9a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/freeform/tokenizer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,11 @@ pub const TokenIterator = struct {

if (!options.peek) {
self.i += token.size();
self.column = if (meta.activeTag(token) != Token.newline) self.column + token.size() else 1;
self.column =
switch (meta.activeTag(token)) {
.newline, .crlf => 1,
else => self.column + token.size(),
};
}

return token;
Expand Down

0 comments on commit 0adfa9a

Please sign in to comment.