(self)
Display the found awesome content on result window
Display the found awesome content on result window
Display the found awesome content on result window
def display(self):
        """Display the found awesome content on result window"""
        self.result_window.erase()
        for idx, val in enumerate(self.matched_blocks[self.top:self.top + self.max_lines]):
            if val['type'] == 'category':
                # Highlight the current cursor line
                if idx == self.current:
                    self.result_window.addstr(idx, 0, shorten(val['line'], self.width, placeholder='...'),
                                              curses.color_pair(2))
                else:
                    self.result_window.addstr(idx, 0, shorten(val['line'], self.width, placeholder='...'),
                                              curses.color_pair(1))
            elif val['type'] == 'awesome':
                # Highlight the current cursor line
                if idx == self.current:
                    self.result_window.addstr(idx, 2, shorten(val['line'], self.width - 3, placeholder='...'),
                                              curses.color_pair(2))
                else:
                    self.result_window.addstr(idx, 2, shorten(val['line'], self.width - 3, placeholder='...'))
        self.result_window.refresh()
def display ( self ) : self . result_window . erase ( ) for idx , val in enumerate ( self . matched_blocks [ self . top : self . top + self . max_lines ] ) : if val [ 'type' ] == 'category' : # Highlight the current cursor line if idx == self . current : self . result_window . addstr ( idx , 0 , shorten ( val [ 'line' ] , self . width , placeholder = '...' ) , curses . color_pair ( 2 ) ) else : self . result_window . addstr ( idx , 0 , shorten ( val [ 'line' ] , self . width , placeholder = '...' ) , curses . color_pair ( 1 ) ) elif val [ 'type' ] == 'awesome' : # Highlight the current cursor line if idx == self . current : self . result_window . addstr ( idx , 2 , shorten ( val [ 'line' ] , self . width - 3 , placeholder = '...' ) , curses . color_pair ( 2 ) ) else : self . result_window . addstr ( idx , 2 , shorten ( val [ 'line' ] , self . width - 3 , placeholder = '...' ) ) self . result_window . refresh ( )