termwiz: fixup regression in sgr parsing for empty parameter case
I broke this with my recent csi parser changes.
This commit is contained in:
1 parent
7192fe7696
commit
aca13c6977
2 files changed
+15
No files matched your search
@@ -2127,6 +2127,10 @@ impl<'a> CSIParser<'a> {
|
||||
}
|
||||
|
||||
match ¶ms[0] {
|
||||
CsiParam::P(b';') => {
|
||||
// Starting with an empty item is equivalent to a reset
|
||||
self.advance_by(1, params, Ok(Sgr::Reset))
|
||||
}
|
||||
CsiParam::P(_) => Err(()),
|
||||
CsiParam::Integer(i) => match FromPrimitive::from_i64(*i) {
|
||||
None => Err(()),
|
||||
|
||||
@@ -867,6 +867,17 @@ mod test {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sgr() {
|
||||
assert_eq!(
|
||||
parse_as("\x1b[;4m", "\x1b[0m\x1b[4m"),
|
||||
vec![
|
||||
Action::CSI(CSI::Sgr(Sgr::Reset)),
|
||||
Action::CSI(CSI::Sgr(Sgr::Underline(Underline::Single))),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn decset() {
|
||||
assert_eq!(
|
||||
|
||||
Reference in new issue
Block a user