Skip to content

Commit

Permalink
fix flake8 formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Aug 1, 2024
1 parent 5cc8998 commit 1ebf82c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions babi/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 1ebf82c

Please sign in to comment.