Exemplo n.º 1
0
def LastEnteredCharIsIdentifierChar():
    current_column = vimsupport.CurrentColumn()
    if current_column - 1 < 0:
        return False
    line = vimsupport.CurrentLineContents()
    filetype = vimsupport.CurrentFiletypes()[0]
    return (identifier_utils.StartOfLongestIdentifierEndingAtIndex(
        line, current_column, filetype) != current_column)
Exemplo n.º 2
0
def CurrentIdentifierFinished():
  current_column = vimsupport.CurrentColumn()
  previous_char_index = current_column - 1
  if previous_char_index < 0:
    return True
  line = vimsupport.CurrentLineContents()
  filetype = vimsupport.CurrentFiletypes()[ 0 ]
  regex = identifier_utils.IdentifierRegexForFiletype( filetype )

  for match in regex.finditer( line ):
    if match.end() == previous_char_index:
      return True
  # If the whole line is whitespace, that means the user probably finished an
  # identifier on the previous line.
  return line[ : current_column ].isspace()
Exemplo n.º 3
0
def CurrentLineContents_EncodedUnicode_test( *args ):
  eq_( vimsupport.CurrentLineContents(), u'fДa' )
Exemplo n.º 4
0
def CompletionStartColumn():
  return ( request_wrap.CompletionStartColumn(
      vimsupport.CurrentLineContents(),
      vimsupport.CurrentColumn() + 1,
      vimsupport.CurrentFiletypes()[ 0 ] ) - 1 )