Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit 7bccb82

Browse files
Show line and file count in results view
1 parent e39a88f commit 7bccb82

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

search_in_project.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ def format_results(self, common_path, results, query):
122122
filename, location = result[0].split(':', 1)
123123
text = result[1]
124124
grouped_by_filename[filename].append((location, text))
125+
line_count = len(results)
126+
file_count = len(grouped_by_filename)
125127

126128
file_results = [self.format_result(common_path, filename, grouped_by_filename[filename]) for filename in grouped_by_filename]
127-
return ("Search In Project results for \"%s\"\n\n" % query) + "\n".join(file_results)
129+
return ("Search In Project results for \"%s\" (%u lines in %u files):\n\n" % (query, line_count, file_count)) \
130+
+ "\n".join(file_results)
128131

129132
def run(self, edit, common_path, results, query):
130133
self.view.set_name('Find Results')

0 commit comments

Comments
 (0)