#NEWLINE# def get_comment_format( ) : #NEWLINE# #INDENT# " Returns a 4-element tuple (first_line, middle_lines, end_line, indent)\n    representing the comment format for the current file.\n\n    It first looks at the 'commentstring', if that ends with %s, it uses that.\n    Otherwise it parses '&comments' and prefers single character comment\n    markers if there are any.\n    " #NEWLINE# commentstring = vim . eval ( '&commentstring' ) #NEWLINE# if commentstring . endswith ( '%s' ) : #NEWLINE# #INDENT# c = commentstring [ : ( - 2 ) ] #NEWLINE# return ( c , c , commentstring , '' ) #NEWLINE# #UNINDENT# comments = _parse_comments ( vim . eval ( '&comments' ) ) #NEWLINE# for c in comments : #NEWLINE# #INDENT# if ( c [ 0 ] == 'SINGLE_CHAR' ) : #NEWLINE# #INDENT# return c [ 1 : ] #NEWLINE# #UNINDENT# #UNINDENT# return comments [ 0 ] [ 1 : ]