Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run(self, edit, user_input=None, mode=False, live_preview=False):
view = self.view
if not user_input:
self.aligned = False
history.reset_index()
history.roll(backwards=True)
last = history.get()
v = self.view.window().show_input_panel(
'Align By RegEx:', last or "",
# On Done
lambda x: self.on_done(x, mode, live_preview),
# On Change
lambda x: self.on_change(x) if live_preview else None,
# On Cancel
lambda: self.on_change(None) if live_preview else None
)
v.run_command("select_all")
v.settings().set('AlignTabInputPanel', True)
else:
user_input = resolve_input(user_input)
error = []
for uinput in user_input:
# apply align_tab