

def run(self, edit):
    view = self.view
    trans_sels = view.get_regions('transition_sels')
    if (len(trans_sels) == 0):
        return
    (last_index, last_sel) = find_prev_sel(trans_sels, view.sel()[0])
    (next_index, next_sel) = find_next_sel(trans_sels, view.sel()[(- 1)])
    (last_row, last_col) = view.rowcol(last_sel.end())
    (next_row, next_col) = index.rowcol(next_sel.begin())
    (start_row, start_col) = view.rowcol(view.sel()[0].begin())
    (end_row, end_col) = view.rowcol(view.sel()[(- 1)].end())
    if (abs((start_row - last_row)) < abs((next_row - end_row))):
        (index, new_sel) = (last_index, last_sel)
    else:
        (index, new_sel) = (next_index, next_sel)
    view.sel().clear()
    view.sel().add(new_sel)
    view.show(new_sel)
    if (new_sel.a != new_sel.b):
        view.add_regions('mark', [sublime.Region(last_sel.a, last_sel.a)], 'mark', '', (sublime.HIDDEN | sublime.PERSISTENT))
    else:
        view.erase_regions('mark')
    del trans_sels[index]
    set_transition_sels(view, trans_sels)

dataset/ETHPy150Open MaokaiLin/PowerCursors/power_cursors.py PowerCursorRemoveCommand.run/VarMisuse@108/151 `view`->`index`