<s> from . base import Base <EOL> class Filter ( Base ) : <EOL> def __init__ ( self , vim ) : <EOL> Base . __init__ ( self , vim ) <EOL> self . name = '<STR_LIT>' <EOL> self . description = '<STR_LIT>' <EOL> def filter ( self , context ) : <EOL> delimiters = self . vim . vars [ '<STR_LIT>' ] <EOL> for candidate , delimiter in [ <EOL> [ x , last_find ( x [ '<STR_LIT>' ] , delimiters ) [ <NUM_LIT:0> ] ] <EOL> for x in context [ '<STR_LIT>' ] <EOL> if ( '<STR_LIT>' in x ) and not last_find ( x [ '<STR_LIT>' ] , delimiters ) and <EOL> last_find ( x [ '<STR_LIT>' ] , delimiters ) ] : <EOL> candidate [ '<STR_LIT>' ] += delimiter <EOL> return context [ '<STR_LIT>' ] <EOL> def last_find ( s , needles ) : <EOL> return [ x for x in needles if s . rfind ( x ) == ( len ( s ) - len ( x ) ) ] </s>
