#NEWLINE# def get_suggestion( self , cli , buffer , document ) : #NEWLINE# #INDENT# history = buffer . history #NEWLINE# text = document . text . rsplit ( '\n' , 1 ) [ ( - 1 ) ] #NEWLINE# if text . strip ( ) : #NEWLINE# #INDENT# for string in reversed ( list ( history ) ) : #NEWLINE# #INDENT# for line in reversed ( string . splitlines ( ) ) : #NEWLINE# #INDENT# if line . startswith ( text ) : #NEWLINE# #INDENT# return Suggestion ( line [ len ( text ) : ] )