Skip to content

Commit f70b13a

Browse files
committed
frontent/ansi.py minor fix
1 parent 94870b8 commit f70b13a

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lib/frontend/ansi.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)