def on_text_command(self, view, command_name, args):
# log('cmd={cmd} args={args}'.format(cmd=command_name, args=args))
if RemoteCppListFilesCommand.owns_view(view) and \
command_name == 'insert' and args['characters'] == '\n':
all_lines = get_multiple_sel_lines(view)
paths = []
for line in all_lines:
if self._is_valid_path(line):
paths.append(line)
def run_in_background():
for path in paths:
file = File(cwd=s_cwd(), path=path)
Commands.open_file(view, file.to_args())
if len(paths) > 10:
msg = ('This will open {0} files which could be slow. \n'
'Are you sure you want to do that?').format(len(paths),)
button_text = 'Open {0} Files'.format(len(paths))
if not sublime.ok_cancel_dialog(msg, button_text):
return None
THREAD_POOL.run(run_in_background)
return None
评论列表
文章目录