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

Commit 8f2e400

Browse files
Merge pull request #46 from henrahmagix/new-option-show-list
Add new option to go straight to the list view
2 parents 8e82a3d + e897fd7 commit 8f2e400

3 files changed

Lines changed: 16 additions & 8 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: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,17 @@ def perform_search(self, text):
8080
self.results = self.engine.run(text, folders)
8181
if self.results:
8282
self.results = [[result[0].replace(self.common_path.replace('\"', ''), ''), result[1][:self.MAX_RESULT_LINE_LENGTH]] for result in self.results]
83-
self.results.append("``` List results in view ```")
84-
flags = 0
85-
self.window.show_quick_panel(
86-
self.results,
87-
self.goto_result,
88-
flags,
89-
self.last_selected_result_index,
90-
self.on_highlighted)
83+
if self.settings.get('search_in_project_show_list_by_default') == 'true':
84+
self.list_in_view()
85+
else:
86+
self.results.append("``` List results in view ```")
87+
flags = 0
88+
self.window.show_quick_panel(
89+
self.results,
90+
self.goto_result,
91+
flags,
92+
self.last_selected_result_index,
93+
self.on_highlighted)
9194
else:
9295
self.results = []
9396
sublime.message_dialog('No results')

0 commit comments

Comments
 (0)