diagnostic_interface.py 文件源码

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

项目:iCompleteMe 作者: jerrymarino 项目源码 文件源码
def _GetKeptAndNewSigns( placed_signs, buffer_number_to_line_to_diags,
                         next_sign_id ):
  new_signs = []
  kept_signs = []
  for buffer_number, line_to_diags in iteritems(
                                            buffer_number_to_line_to_diags ):
    if not vimsupport.BufferIsVisible( buffer_number ):
      continue

    for line, diags in iteritems( line_to_diags ):
      # Only one sign is visible by line.
      first_diag = diags[ 0 ]
      sign = _DiagSignPlacement( next_sign_id,
                                 line,
                                 buffer_number,
                                 _DiagnosticIsError( first_diag ) )
      if sign not in placed_signs:
        new_signs.append( sign )
        next_sign_id += 1
      else:
        # We use .index here because `sign` contains a new id, but
        # we need the sign with the old id to unplace it later on.
        # We won't be placing the new sign.
        kept_signs.append( placed_signs[ placed_signs.index( sign ) ] )
  return new_signs, kept_signs, next_sign_id
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号