mirror of
				https://github.com/rm-dr/daisy
				synced 2025-11-03 15:04:25 -08:00 
			
		
		
		
	Fixed error printing
This commit is contained in:
		
							
								
								
									
										16
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								src/main.rs
									
									
									
									
									
								
							@ -46,17 +46,23 @@ pub fn do_string(
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	let (l, e) = r;
 | 
						let (l, e) = r;
 | 
				
			||||||
	let t = FormattedText::new(
 | 
						let mut t = FormattedText::new("".to_string());
 | 
				
			||||||
		format!(
 | 
						if l.zero() {
 | 
				
			||||||
 | 
							t.push(&format!(
 | 
				
			||||||
 | 
								"\n  {}\n\n",
 | 
				
			||||||
 | 
								e.text().to_string(),
 | 
				
			||||||
 | 
							));
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							t.push(&format!(
 | 
				
			||||||
			concat!(
 | 
								concat!(
 | 
				
			||||||
				"{}[e]{}[n]\n",
 | 
									"{}[e]{}[n]\n",
 | 
				
			||||||
				"  {}\n"
 | 
									"  {}\n\n"
 | 
				
			||||||
			),
 | 
								),
 | 
				
			||||||
			" ".repeat(l.pos + 4),
 | 
								" ".repeat(l.pos + 4),
 | 
				
			||||||
			"^".repeat(l.len),
 | 
								"^".repeat(l.len),
 | 
				
			||||||
			e.text().to_string(),
 | 
								e.text().to_string(),
 | 
				
			||||||
		)
 | 
							));
 | 
				
			||||||
	);
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return Err(t);
 | 
						return Err(t);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user