1
Fork 0

Better handling of tab in error

This commit is contained in:
Seo Sanghyeon 2016-05-09 23:09:25 +09:00
parent 50909f2d50
commit c331032755
2 changed files with 32 additions and 2 deletions

View file

@ -312,9 +312,15 @@ impl StyledBuffer {
self.text[line][col] = chr;
self.styles[line][col] = style;
} else {
while self.text[line].len() < col {
self.text[line].push(' ');
let mut i = self.text[line].len();
while i < col {
let s = match self.text[0].get(i) {
Some(&'\t') => '\t',
_ => ' '
};
self.text[line].push(s);
self.styles[line].push(Style::NoStyle);
i += 1;
}
self.text[line].push(chr);
self.styles[line].push(style);