diff --git a/babi/file.py b/babi/file.py index c93c505..ecc6652 100644 --- a/babi/file.py +++ b/babi/file.py @@ -190,16 +190,22 @@ def __init__( def __iter__(self) -> _SearchIter: return self - def calc_past_original_offset(self, y: int, match: Match[str], replacement: str) -> None: + def calc_past_original_offset( + self, y: int, match: Match[str], replacement: str + ) -> None: if not self.wrapped or y != self._start_y: return - self.original_line_change_diff += len(replacement) - (match.end() - match.start()) + self.original_line_change_diff += ( + len(replacement) - match.end() - match.start() + ) def _stop_if_past_original(self, y: int, match: Match[str]) -> Found: if ( self.wrapped and ( y > self._start_y or - y == self._start_y and match.start() >= self._start_x + self.original_line_change_diff + y == self._start_y and match.start() >= ( + self._start_x + self.original_line_change_diff + ) ) ): raise StopIteration()