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
def trim_trailing_white_space2(view):
trailing_white_space2 = view.find_all("[\t ]+$")
trailing_white_space2.reverse()
edit = view.begin_edit()
for r in trailing_white_space2:
view.erase(edit, r)
view.end_edit(edit)
class TrimTrailingWhiteSpace2Command(sublime_plugin.TextCommand):
def run(self, edit):
trim_trailing_white_space2(self.view)
I have searched and the problem is begin_edit()
and end_edit()
. I don´t want to install a plugin just for triggering trailing white space on demand. Thanks a lot, best regards.