def replace_confirming(self, edit, pattern, compiled_rx, replacement,
                replace_count, target_region):
        last_row = row_at(self.view, 1 - target_region.b)
        start = target_region.begin()

        while True:
            match = self.view.find(pattern, start)

            # no match or match out of range -- stop
            if (match == R(-1)) or (row_at(self.view, match.a) > last_row):
                self.view.show(first_sel(self.view).begin())
                return

            size_before = self.view.size()

            with adding_regions(self.view, 's_confirm', [match], 'comment'):
                self.view.show(match.a, True)
                if sublime.ok_cancel_dialog("Confirm replacement?"):
                    text = self.view.substr(match)
                    substituted = re.sub(compiled_rx, replacement, text, count=replace_count)
                    self.view.replace(edit, match, substituted)

            start = match.b + (self.view.size() - size_before)
dataset/ETHPy150Open guillermooo/Vintageous/ex_commands.py/ExSubstitute.replace_confirming/swapped operands of `-`