mirror of https://github.com/helix-editor/helix
chore: improve error messages
parent
03d627a20d
commit
3fed359a0f
|
@ -61,7 +61,7 @@ pub fn parse_selection_string(s: &str) -> Result<(String, Selection), ParseSelec
|
||||||
|
|
||||||
if is_primary && primary_idx.is_some() {
|
if is_primary && primary_idx.is_some() {
|
||||||
return Err(ParseSelectionError::MoreThanOnePrimary(format!(
|
return Err(ParseSelectionError::MoreThanOnePrimary(format!(
|
||||||
"{:?} {:?}",
|
"Can only have 1 primary selection: {:?} {:?}",
|
||||||
left, s
|
left, s
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
@ -121,12 +121,12 @@ pub fn parse_selection_string(s: &str) -> Result<(String, Selection), ParseSelec
|
||||||
|
|
||||||
if head_at_beg {
|
if head_at_beg {
|
||||||
return Err(ParseSelectionError::MissingClosingPair(format!(
|
return Err(ParseSelectionError::MissingClosingPair(format!(
|
||||||
"Missing end `{}#` {:?} {:?}",
|
"Missing end `{}#`: {:?} {:?}",
|
||||||
close_pair, left, s
|
close_pair, left, s
|
||||||
)));
|
)));
|
||||||
} else {
|
} else {
|
||||||
return Err(ParseSelectionError::MissingClosingPair(format!(
|
return Err(ParseSelectionError::MissingClosingPair(format!(
|
||||||
"Missing end `|{}#` {:?} {:?}",
|
"Missing end `|{}#`: {:?} {:?}",
|
||||||
close_pair, left, s
|
close_pair, left, s
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ pub fn parse_selection_string(s: &str) -> Result<(String, Selection), ParseSelec
|
||||||
Some(i) => i,
|
Some(i) => i,
|
||||||
None => {
|
None => {
|
||||||
return Err(ParseSelectionError::MissingPrimary(format!(
|
return Err(ParseSelectionError::MissingPrimary(format!(
|
||||||
"Missing primary `#[|]#` {:?}",
|
"Missing primary `#[|]#:` {:?}",
|
||||||
s
|
s
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue