fix: take the last range element by default if the query error isn't found
This commit is contained in:
parent
3f44b89685
commit
137483c7b9
1 changed files with 1 additions and 1 deletions
|
|
@ -782,7 +782,7 @@ impl<'a> LanguageConfiguration<'a> {
|
|||
let (path, range) = ranges
|
||||
.iter()
|
||||
.find(|(_, range)| range.contains(&offset_within_section))
|
||||
.unwrap();
|
||||
.unwrap_or(ranges.last().unwrap());
|
||||
error.offset = offset_within_section - range.start;
|
||||
error.row = source[range.start..offset_within_section]
|
||||
.chars()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue