(self, c)
Enable gg like in vim
Enable gg like in vim
Enable gg like in vim
def start_gg(self, c):
        '''Enable gg like in vim'''

        gg = chr(c)
        while True:
            try:
                c = self.control.stdscr.getch()
            except KeyboardInterrupt:
                c = 4

            if gg[-1] == 'g' and c == ord('g') and gg[:-1] != '':
                if int(gg[:-1]) > len(self.dir_cont):
                    self.highlight = len(self.dir_cont) -1
                else:
                    self.highlight = int(gg[:-1]) -1
                return True
            elif gg[-1] == 'g' and c == ord('g') and gg[:-1] == '':
                self.highlight = 0
                return True
            elif gg[-1] != 'g' and c == ord('g'):
                gg += 'g'
            elif 48 <= c <= 57 and gg[-1] != 'g':
                gg += chr(c)
            elif c in self.lookup:
                return c
def start_gg ( self , c ) : gg = chr ( c ) while True : try : c = self . control . stdscr . getch ( ) except KeyboardInterrupt : c = 4 if gg [ - 1 ] == 'g' and c == ord ( 'g' ) and gg [ : - 1 ] != '' : if int ( gg [ : - 1 ] ) > len ( self . dir_cont ) : self . highlight = len ( self . dir_cont ) - 1 else : self . highlight = int ( gg [ : - 1 ] ) - 1 return True elif gg [ - 1 ] == 'g' and c == ord ( 'g' ) and gg [ : - 1 ] == '' : self . highlight = 0 return True elif gg [ - 1 ] != 'g' and c == ord ( 'g' ) : gg += 'g' elif 48 <= c <= 57 and gg [ - 1 ] != 'g' : gg += chr ( c ) elif c in self . lookup : return c