another Windows \r\n bug fix

pull/1011/head
Alexander Medvednikov 2019-07-05 22:07:44 +02:00
parent 871fb3831a
commit 8d407cec90
1 changed files with 4 additions and 1 deletions

View File

@ -137,7 +137,10 @@ fn (s Scanner) has_gone_over_line_end() bool {
fn (s mut Scanner) skip_whitespace() {
for s.pos < s.text.len && is_white(s.text[s.pos]) {
if is_nl(s.text[s.pos]) {
s.line_nr++
// Count \r\n as one line
if !(s.text[s.pos] == `\n` && s.text[s.pos-1] == `\r`) {
s.line_nr++
}
if s.is_fmt {
return
}