(self)
Find a directory or file like in ranger
Find a directory or file like in ranger
Find a directory or file like in ranger
def find(self):
        '''Find a directory or file like in ranger'''

        filename = Editor(self.control.stdscr, max_text_size=1,
                          win_location=(0, 1), win_size=(1, 80),
                          title="Filename to find: ")()
        if filename == '' and self.find_pos < len(self.find_rem) - 1:
            self.find_pos += 1
        elif filename == '':
            self.find_pos = 0
        else:
            self.find_rem = []
            self.find_pos = 0
            for i in self.dir_cont:
                if filename.lower() in i.lower():
                    self.find_rem.append(i)
        if self.find_rem:
            self.highlight = self.dir_cont.index(self.find_rem[self.find_pos])
def find ( self ) : filename = Editor ( self . control . stdscr , max_text_size = 1 , win_location = ( 0 , 1 ) , win_size = ( 1 , 80 ) , title = "Filename to find: " ) ( ) if filename == '' and self . find_pos < len ( self . find_rem ) - 1 : self . find_pos += 1 elif filename == '' : self . find_pos = 0 else : self . find_rem = [ ] self . find_pos = 0 for i in self . dir_cont : if filename . lower ( ) in i . lower ( ) : self . find_rem . append ( i ) if self . find_rem : self . highlight = self . dir_cont . index ( self . find_rem [ self . find_pos ] )