mirror of
https://github.com/ratatui/ratatui.git
synced 2025-10-02 07:21:24 +00:00
buffer: add quotes to fmt::Debug for better testing experience
This commit is contained in:
parent
8cdfc883b9
commit
89dac9d2a6
@ -116,14 +116,12 @@ impl Default for Buffer {
|
|||||||
impl fmt::Debug for Buffer {
|
impl fmt::Debug for Buffer {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
writeln!(f, "Buffer: {:?}", self.area)?;
|
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 cells in self.content.chunks(self.area.width as usize) {
|
||||||
for cell in cells {
|
let line: String = cells.iter().map(|cell| &cell.symbol[..]).collect();
|
||||||
f.write_str(&cell.symbol)?;
|
f.write_fmt(format_args!("{:?},\n", line))?;
|
||||||
}
|
|
||||||
f.write_str("\n")?;
|
|
||||||
}
|
}
|
||||||
f.write_str("Style\n")?;
|
f.write_str("Style:\n")?;
|
||||||
for cells in self.content.chunks(self.area.width as usize) {
|
for cells in self.content.chunks(self.area.width as usize) {
|
||||||
f.write_str("|")?;
|
f.write_str("|")?;
|
||||||
for cell in cells {
|
for cell in cells {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user