def LastEnteredCharIsIdentifierChar(): line, current_column = vimsupport.CurrentLineContentsAndCodepointColumn() if current_column - 1 < 0: return False filetype = vimsupport.CurrentFiletypes()[0] return (identifier_utils.StartOfLongestIdentifierEndingAtIndex( line, current_column, filetype) != current_column)
def CurrentIdentifierFinished(): line, current_column = vimsupport.CurrentLineContentsAndCodepointColumn() previous_char_index = current_column - 1 if previous_char_index < 0: return True 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()