Replace tabs by spaces.
This commit is contained in:
parent
e4979bdd35
commit
ed2906756b
1 changed files with 6 additions and 1 deletions
|
@ -52,7 +52,12 @@ impl Buffer {
|
||||||
pub fn push(&mut self, value: char) {
|
pub fn push(&mut self, value: char) {
|
||||||
// Reset error message.
|
// Reset error message.
|
||||||
self.message = None;
|
self.message = None;
|
||||||
self.content.push(value);
|
match value {
|
||||||
|
// Replace tabs by four spaces.
|
||||||
|
'\t' => self.content.push_str(" "),
|
||||||
|
// Append anything else as is.
|
||||||
|
_ => self.content.push(value),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove last char.
|
// Remove last char.
|
||||||
|
|
Loading…
Reference in a new issue