add ; for print support and fix bug print line
This commit is contained in:
parent
7bbda6fa66
commit
bec4429c3a
1 changed files with 4 additions and 2 deletions
|
@ -29,7 +29,7 @@ impl Buffer {
|
|||
}
|
||||
|
||||
pub fn print(&mut self, addr: Address, print_numbers: bool) {
|
||||
let last_line = self.buffer.len().saturating_sub(1);
|
||||
let last_line = self.buffer.len();
|
||||
match addr {
|
||||
Address::Actual => self.print_line(self.current_line, print_numbers),
|
||||
Address::Line(l) => self.print_line(l.saturating_sub(1), print_numbers),
|
||||
|
@ -38,8 +38,10 @@ impl Buffer {
|
|||
Address::FromTo(a, b) => self.print_range(a, b, print_numbers),
|
||||
Address::FromStartTo(a) => self.print_range(0, a, print_numbers),
|
||||
Address::FromToEnd(a) => self.print_range(a, last_line, print_numbers),
|
||||
Address::FromActTo(a) => self.print_range(self.current_line, a, print_numbers),
|
||||
Address::FromActToEnd => self.print_range(self.current_line, last_line, print_numbers),
|
||||
Address::Null => println!("nul !"),
|
||||
_ => println!("coucou2"),
|
||||
_ => println!("pas implémenté"),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue