Maybe it makes sense to make regions_transformer reversed by default
srghma opened this issue · 0 comments
srghma commented
I can`t find why this will be for bad: if someone not only transform selected regions, but also edit text - then selection become stale
def regions_transformer_reversed(view, f):
sels = reversed(view.sel())
new = []
for sel in sels:
region = f(view, sel)
if not isinstance(region, sublime.Region):
raise TypeError('sublime.Region required')
new.append(region)
view.sel().clear()
view.sel().add_all(new)