@requires_segment_info
def file_name(pl, segment_info, display_no_file=False, no_file_text=u'[No file]'):
 name = buffer_name(segment_info)
 if (not name):
  if display_no_file:
   return [{u'contents': no_file_text, u'highlight_groups': [u'file_name_no_file', u'file_name']}]
  else:
   return None
 return os.path.basename(name).decode(segment_info[u'encoding'], u'powerline_vim_strtrans_error')

@ requires_segment_info def file_name ( pl , segment_info , display_no_file = False , no_file_text = u'[No file]' ) : name = buffer_name ( segment_info ) if ( not name ) : if display_no_file : return [ { u'contents' : no_file_text , u'highlight_groups' : [ u'file_name_no_file' , u'file_name' ] } ] else : return None return os . path . basename ( name ) . decode ( segment_info [ u'encoding' ] , u'powerline_vim_strtrans_error' )
return file name .