Do not add project path in files from project search

This commit is contained in:
Francesco Abbate 2021-01-13 17:09:35 +01:00
parent fcf763fe9c
commit 9412b3f0d8
1 changed files with 2 additions and 1 deletions

View File

@ -52,7 +52,8 @@ function ResultsView:begin_search(text, fn)
local i = 1
for dir_name, file in core.get_project_files() do
if file.type == "file" then
find_all_matches_in_file(self.results, dir_name .. PATHSEP .. file.filename, fn)
local path = (dir_name == core.project_dir and "" or (dir_name .. PATHSEP))
find_all_matches_in_file(self.results, path .. file.filename, fn)
end
self.last_file_idx = i
i = i + 1