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

Commit 6787ee2

Browse files
committed
Add new option to go straight to the list view
This allows SearchInProject to act identically to SublimeText's search by immediately showing the Find Results view. This must be turned on to `true`; by default it is off, so no change in functionality.
1 parent 6ef98c7 commit 6787ee2

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog for SearchInProject
22

3+
## Upcoming
4+
5+
* Add new option `search_in_project_show_list_by_default` to skip the quick panel and go straight to the list view
6+
37
## v1.8.0 2016-10-31
48

59
* Support Ripgrep

SearchInProject.sublime-settings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/* The default is grep because it's widely available on *nix machines, but ack and The Silver Searcher are both faster, */
88
/* and git grep is also faster, but only works inside a Git repository */
99
"search_in_project_engine": "grep",
10+
"search_in_project_show_list_by_default": "false",
1011

1112
/* Grep configuration */
1213
/* Path to grep executable; if the standard one doesn't work for you, you can specify an explicit path in your user config file. */

search_in_project.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ def perform_search(self, text):
6666
self.results = self.engine.run(text, folders)
6767
if self.results:
6868
self.results = [[result[0].replace(self.common_path.replace('\"', ''), ''), result[1][:self.MAX_RESULT_LINE_LENGTH]] for result in self.results]
69-
self.results.append("``` List results in view ```")
70-
self.window.show_quick_panel(self.results, self.goto_result)
69+
if self.settings.get('search_in_project_show_list_by_default') == 'true':
70+
self.list_in_view()
71+
else:
72+
self.results.append("``` List results in view ```")
73+
self.window.show_quick_panel(self.results, self.goto_result)
7174
else:
7275
self.results = []
7376
sublime.message_dialog('No results')

0 commit comments

Comments
 (0)