Protect LinesIterator from zero width

Fixes #147
This commit is contained in:
Alexandre Bury 2017-08-01 09:44:40 -07:00
parent c281f93a63
commit d2f2f642c1

View File

@ -99,7 +99,11 @@ impl<'a> Iterator for LinesIterator<'a> {
let content = &content[..next]; let content = &content[..next];
let allowed_width = if self.show_spaces { let allowed_width = if self.show_spaces {
self.width - 1 if self.width < 1 {
0
} else {
self.width - 1
}
} else { } else {
self.width self.width
}; };