Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions anyrun/src/plugin_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,21 @@ impl FactoryComponent for PluginBox {
{
let mut guard = self.matches.guard();

guard.clear();

for _match in matches {
guard.push_back((_match, self.config.clone()));
let len_new_matches = matches.len();
let len_old_matches = guard.len();
let mut skipped = 0;

while skipped < len_new_matches && skipped < len_old_matches {
if guard[skipped].content != matches[skipped] {
Comment thread
jinliu marked this conversation as resolved.
break;
}
skipped += 1;
}
while guard.len() > skipped {
guard.pop_back();
}
for _match in matches.iter().skip(skipped) {
guard.push_back((_match.clone(), self.config.clone()));
}
}
sender.output(PluginBoxOutput::MatchesLoaded).unwrap();
Expand Down
Loading