We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94554f8 commit 4a8b6edCopy full SHA for 4a8b6ed
espflash/src/error.rs
@@ -250,7 +250,16 @@ impl PartitionTableError {
250
let snip_end =
251
SourceOffset::from_location(&source, err_pos.line().saturating_add(2) as usize, 0);
252
let snip = SourceSpan::new(snip_start, (snip_end.offset() - snip_start.offset()).into());
253
- let err_span = SourceSpan::new(pos_to_offset(err_pos), 0.into());
+
254
+ // since csv doesn't give us the position in the line the error occurs, we highlight the entire line
255
+ let line_length = (source
256
+ .lines()
257
+ .nth(err_pos.line() as usize - 1)
258
+ .unwrap()
259
+ .len()
260
+ - 1)
261
+ .into();
262
+ let err_span = SourceSpan::new(pos_to_offset(err_pos), line_length);
263
264
PartitionTableError {
265
source,
0 commit comments