Related with the third answer from this question, I would like to refactor this simple plugin so that it works with Sublime Text 3. Please, could you help me? I am new to python, and I don´t know anything about plugin development for sublime.
import sublime, sublime_plugin
trailing_white_space2 = view.find_all("[\t ]+$")
edit = view.begin_edit()
for r in trailing_white_space2:
def run(self, edit):
Working on ST3.
import sublime, sublime_plugin class TrimTrailingWhiteSpace2Command(sublime_plugin.TextCommand): def run(self, edit): trailing_white_space = self.view.find_all("[\t ]+$") trailing_white_space.reverse() for r in trailing_white_space: self.view.erase(edit, r) class TrimTrailingWhiteSpace2(sublime_plugin.EventListener): def run(self, view): view.run_command("trim_trailing_white_space2")