def undo_me(self, view):
view.settings().erase('prevent_detect')
view.run_command('undo')
# restore folded regions
regions = view.settings().get('folded_regions')
if regions:
view.settings().erase('folded_regions')
folded = [sublime.Region(int(region[0]), int(region[1])) for region in regions]
view.fold(folded)
vp = view.settings().get('viewport_position')
if vp:
view.settings().erase('viewport_position')
view.set_viewport_position((vp[0], vp[1]), False)
# st3 will reload file immediately
if view.settings().get('revert_to_scratch') or (ST3 and not get_setting(view, 'lazy_reload')):
view.set_scratch(True)
评论列表
文章目录