Skip to content

Commit b31d1f6

Browse files
committed
When searching to map local files, as well as looking in the currently opened folder, look in folders containing any opened files as well
1 parent 3ffffd1 commit b31d1f6

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

swi.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,21 @@ def remote_debug_url_selected(self, index):
216216
debugger_enabled = False
217217
global file_to_scriptId
218218
file_to_scriptId = []
219-
self.project_folders = self.window.folders()
219+
220+
# Look in the folders opened in Sublime first
221+
self.project_folders = [s.lower() for s in self.window.folders()]
222+
223+
# Then also look at the folders containing currently open files
224+
for v in window.views():
225+
file = v.file_name()
226+
if file and os.path.isfile(file):
227+
dir = os.path.dirname(file).lower()
228+
# simple protection against disk root - we're going to recurse below
229+
if len(dir) > 3 and not dir in self.project_folders:
230+
self.project_folders.append(dir)
231+
232+
[logger.info('Aware of folder %s' % s) for s in self.project_folders]
233+
220234
self.url = url
221235

222236
global channel

0 commit comments

Comments
 (0)