some issue

This commit is contained in:
2024-10-31 19:00:39 +01:00
parent 92ab35c4ef
commit 55f52f786f
4 changed files with 83 additions and 35 deletions
+3 -2
View File
@@ -26,9 +26,10 @@ pub fn compress_string(input: &str, re: &Regex) -> (String, HashMap<usize, Strin
let mut i = 0;
while i < input_chars.len() {
if let Some(loc) = re.find(&input[i..]) {
if let Some(loc) = re.find(&(input_chars[i..]).iter().collect::<String>()) {
if loc.start() == 0 {
let ansi_seq = &input[i..i + loc.end()];
let ansi_seq = &(input_chars[i..i + loc.end()]).iter().collect::<String>();
// let ansi_seq = &input[i..i + loc.end()];
matches_map.insert(res.len(), ansi_seq.to_string());
i += ansi_seq.chars().count();
} else {