MCPcopy Create free account
hub / github.com/chasingboy/Xtools / run

Method run

xtools.py:235–252  ·  view source on GitHub ↗
(self, edit)

Source from the content-addressed store, hash-verified

233
234class DeleteLinesCommand(sublime_plugin.TextCommand):
235 def run(self, edit):
236 buffers = get_buffer_text(self.view)
237 delstr = get_console_text(self.view).strip('\n').split('\n')
238 if len(delstr) == 0:
239 sublime.message_dialog('[error] Please select input text and input finding strings')
240 return
241
242 text = ''
243 for line in buffers.split('\n'):
244 flag = False
245 for ds in delstr:
246 if ds in line or ds == line:
247 flag = True
248 break
249 if flag == False:
250 text += line + '\n'
251
252 update_file(self.view, edit, text)
253
254
255class SelectLinesCommand(sublime_plugin.TextCommand):

Callers

nothing calls this directly

Calls 3

get_buffer_textFunction · 0.85
get_console_textFunction · 0.85
update_fileFunction · 0.85

Tested by

no test coverage detected