mirror of
https://github.com/ratatui-org/ratatui
synced 2025-02-16 22:18:51 +00:00
buffer: add quotes to fmt::Debug for better testing experience
This commit is contained in:
parent
8cdfc883b9
commit
89dac9d2a6
1 changed files with 4 additions and 6 deletions
|
@ -116,14 +116,12 @@ impl Default for Buffer {
|
|||
impl fmt::Debug for Buffer {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
writeln!(f, "Buffer: {:?}", self.area)?;
|
||||
f.write_str("Content\n")?;
|
||||
f.write_str("Content (quoted lines):\n")?;
|
||||
for cells in self.content.chunks(self.area.width as usize) {
|
||||
for cell in cells {
|
||||
f.write_str(&cell.symbol)?;
|
||||
}
|
||||
f.write_str("\n")?;
|
||||
let line: String = cells.iter().map(|cell| &cell.symbol[..]).collect();
|
||||
f.write_fmt(format_args!("{:?},\n", line))?;
|
||||
}
|
||||
f.write_str("Style\n")?;
|
||||
f.write_str("Style:\n")?;
|
||||
for cells in self.content.chunks(self.area.width as usize) {
|
||||
f.write_str("|")?;
|
||||
for cell in cells {
|
||||
|
|
Loading…
Add table
Reference in a new issue