louiealmeda / directory-search

Brackets Extension for file searching
2 stars 3 forks source link

Filter Not Working - Brackets 1.7 #2

Open rzaleski-techdynamism opened 8 years ago

rzaleski-techdynamism commented 8 years ago

This doesn't seem to work with the latest version of Brackets. The HTML for the folder structure seems to be:

<li class="jstree-leaf" data-reactid=".0.4.$=1github.3.$PULL_REQUEST_TEMPLATE=1md"><ins class="jstree-icon" data-reactid=".0.4.$=1github.3.$PULL_REQUEST_TEMPLATE=1md.0"> </ins>
<a href="#" class="" data-reactid=".0.4.$=1github.3.$PULL_REQUEST_TEMPLATE=1md.1">
    <ins class="jstree-icon" data-reactid=".0.4.$=1github.3.$PULL_REQUEST_TEMPLATE=1md.1.0"> </ins>
    <span data-reactid=".0.4.$=1github.3.$PULL_REQUEST_TEMPLATE=1md.1.1">PULL_REQUEST_TEMPLATE</span><span class="extension" data-reactid=".0.4.$=1github.3.$PULL_REQUEST_TEMPLATE=1md.1.2">.md</span>
</a></li>

The current code to pull the file name is:

file.attr("data-file-name", parts[1].innerHTML + parts[2].innerHTML);

It should be

file.attr("data-file-name", parts[0].innerHTML + parts[1].innerHTML);

rzaleski-techdynamism commented 8 years ago

@louiealmeda - FYI...

MerryPanda commented 7 years ago

yep, it still doesn't work on 1.8

rzaleski-techdynamism commented 7 years ago

@MerryPanda - Does the above fix work on 1.8?

MerryPanda commented 7 years ago

hey, i didn't do anything but it works not ^_^

here is my string you were speaking about:

 file.attr("data-file-name", parts[1].innerHTML + parts[2].innerHTML);

looks like nothing has changed

cheers

Zegnat commented 7 years ago

This patch makes things work for me:

--- main.js
+++ main.js
@@ -87,7 +87,7 @@

                 var parts = file.find("a span");

-                file.attr("data-file-name", parts[1].innerHTML + parts[2].innerHTML);
+                file.attr("data-file-name", parts.text());

             });

Note that this was made against version 1.1.1, from the Brackets Extension Registry. This repository only contains version 1.1.0. I am not sure if that makes a difference, bt thought I would point that out.