about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTheofilos Augoustis <theofilos.augoustis@gmail.com>2025-11-27 13:49:44 +0000
committerTheofilos Augoustis <theofilos.augoustis@gmail.com>2025-11-27 13:49:44 +0000
commit6fa8a153f7924f4c2bdea8c4e7615f72f247ee51 (patch)
treef1d1571a88a9ad67412a7300c450069f93a106cc
parent9f9ddd9e4454a9240de9f783134ae6657e39627b (diff)
downloadfocaccia-6fa8a153f7924f4c2bdea8c4e7615f72f247ee51.tar.gz
focaccia-6fa8a153f7924f4c2bdea8c4e7615f72f247ee51.zip
Skip skipped events when peeking at next event
-rw-r--r--src/focaccia/deterministic.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/focaccia/deterministic.py b/src/focaccia/deterministic.py
index c4d37ad..9db79b7 100644
--- a/src/focaccia/deterministic.py
+++ b/src/focaccia/deterministic.py
@@ -334,7 +334,12 @@ finally:
             if self.matched_count is None:
                 raise ValueError('Cannot get next event with unsynchronized event matcher')
             if self.matched_count < len(self.events):
-                return self.events[self.matched_count]
+                count = self.matched_count
+                while count in self.skipped_events:
+                    count += 1
+                if count < len(self.events):
+                    return self.events[count]
+                return None
             return None
 
         def match_pair(self, event: Event | None):