hello
I was missing a command to erase only blank chars (\n, \r, \r and nbsp).
so I did a simple plugin and assigned to ctrl+shift+delete and ctrl+shift+backspace
import sublime, sublimeplugin, re
class RightEraseBlankCharsCommand(sublimeplugin.TextCommand):
def run(self, view, args):
pt = re.compile(r" \n\r\t]");
sz = view.size();
for region in view.sel():
p = region.begin()
while pt.match(view.substr(p)) and p < sz :
view.erase(sublime.Region(p,p+1))
class LeftEraseBlankCharsCommand(sublimeplugin.TextCommand):
def run(self, view, args):
pt = re.compile(r" \n\r\t]");
sz = view.size();
for region in view.sel():
p = region.end()-1
while p > 1 and pt.match(view.substr(p)) :
view.erase(sublime.Region(p,p+1))
p -= 1
I couldn’t think of anything better, but it works
if you can, please help improving it
I hope it’s useful, at least it is for me
bye