def run(self, edit):
def setIndentWithSpace(text):
s = sublime.load_settings('phpfmt.sublime-settings')
v = text.strip()
if not v:
v = False
else:
v = int(v)
s.set("indent_with_space", v)
sublime.save_settings('phpfmt.sublime-settings')
sublime.status_message("phpfmt (indentation): done")
sublime.active_window().active_view().run_command("fmt_now")
s = sublime.load_settings('phpfmt.sublime-settings')
spaces = s.get("indent_with_space", 4)
if not spaces:
spaces = ""
spaces = str(spaces)
self.view.window().show_input_panel('how many spaces? (leave it empty to return to tabs)', spaces, setIndentWithSpace, None, None)
评论列表
文章目录