Ensure order of omitted parameters is retained

Fixes #4730
This commit is contained in:
Josiah Outram Halstead authored and Wez Furlong committed 2024-01-08 18:22:30 -07:00
1 parent 9fc89e621f
commit b6faedf31f
1 file changed
+23
+23
View File
@@ -444,6 +444,7 @@ impl VTParser {
for src in &self.params[0..self.num_params] {
if let CsiParam::Integer(value) = src {
res[i] = *value;
} else if let CsiParam::P(b';') = src {
i += 1;
}
}
@@ -1103,4 +1104,26 @@ mod test {
]
);
}
#[test]
fn test_ommitted_dcs_param() {
assert_eq!(
parse_as_vec("\x1bP;1q\x1b\\".as_bytes()),
vec![
VTAction::DcsHook {
byte: b'q',
params: vec![0, 1],
intermediates: vec![],
ignored_excess_intermediates: false,
},
VTAction::DcsUnhook,
VTAction::EscDispatch {
params: vec![],
intermediates: vec![],
ignored_excess_intermediates: false,
byte: b'\\',
}
]
);
}
}