@@ -102,12 +102,21 @@ def _visualize(answers, request_options, search_mode=False):
102102 answer = answer_dict ['answer' ]
103103 found = found and not topic_type == 'unknown'
104104
105+ if search_mode and topic != 'LIMITED' :
106+ if not highlight :
107+ result += "\n [%s]\n " % topic
108+ else :
109+ result += "\n %s%s %s %s%s\n " % (
110+ colored .bg ('dark_gray' ), colored .attr ("res_underlined" ),
111+ topic ,
112+ colored .attr ("res_underlined" ), colored .attr ('reset' ))
113+
105114 if answer_dict ['format' ] in ['ansi' , 'text' ]:
106115 result += answer
107116 elif topic == ':firstpage-v1' :
108117 result += fmt .internal .colorize_internal_firstpage_v1 (answer )
109118 elif topic == 'LIMITED' :
110- result += _limited_answer (answer )
119+ result += _limited_answer (topic )
111120 else :
112121 result += _colorize_ansi_answer (
113122 topic , answer , color_style ,
@@ -116,14 +125,6 @@ def _visualize(answers, request_options, search_mode=False):
116125 and not request_options .get ('add_comments' )
117126 and not request_options .get ('remove_text' )))
118127
119- if search_mode :
120- if not highlight :
121- result += "\n [%s]\n " % topic
122- else :
123- result += "\n %s%s %s %s%s\n " % (
124- colored .bg ('dark_gray' ), colored .attr ("res_underlined" ),
125- topic ,
126- colored .attr ("res_underlined" ), colored .attr ('reset' ))
127128
128129 result = result .strip ('\n ' ) + "\n "
129130 return result , found
0 commit comments