RemoteCpp.py 文件源码

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

项目:RemoteCpp 作者: ruibm 项目源码 文件源码
def show_file_input(view, title, on_done):
  file = STATE.file(view.file_name())
  if file == None:
    path = s_cwd()
    path = path + os.sep
  else:
    path = file.remote_path()
  def on_done_callback(new_file):
    log('The user has chosen: ' + new_file)
    cwd = s_cwd()
    if not new_file.startswith(cwd):
      sublime.error_message('File must be under CWD:\n\n' + cwd)
      return
    path = new_file[len(cwd) + 1:]
    file = File(cwd=cwd, path=path)
    on_done(file)
  view.window().show_input_panel(
      caption=title,
      initial_text=path,
      on_done=on_done_callback,
      on_change=None,
      on_cancel=None,
  )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号