RemoteCpp.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:RemoteCpp 作者: ruibm 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号