diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-13 13:25:56 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-13 13:25:56 -0300 |
commit | 20b45678293551f9fdb5a4b13ec1d5871a3d9cf8 (patch) | |
tree | 24bf08bb47ef788c7b103eadf73f5d10ecb46c52 /tools/editor/quick_open.cpp | |
parent | 7127f0943df4790f49afa8fda084ea6dff705e7e (diff) | |
parent | feb95fa9ace04a3f2eb883e39995b962fde09561 (diff) | |
download | redot-engine-20b45678293551f9fdb5a4b13ec1d5871a3d9cf8.tar.gz |
Merge pull request #5177 from vnen/string-subsequence
Add subsequence search to tools
Diffstat (limited to 'tools/editor/quick_open.cpp')
-rw-r--r-- | tools/editor/quick_open.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/editor/quick_open.cpp b/tools/editor/quick_open.cpp index 72059c264f..fc2a2241ab 100644 --- a/tools/editor/quick_open.cpp +++ b/tools/editor/quick_open.cpp @@ -126,7 +126,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd) { path+="/"; if (path!="res://") { path=path.substr(6,path.length()); - if (path.findn(search_box->get_text())!=-1) { + if (search_box->get_text().is_subsequence_ofi(path)) { TreeItem *ti = search_options->create_item(root); ti->set_text(0,path); Ref<Texture> icon = get_icon("folder","FileDialog"); @@ -138,7 +138,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd) { String file = efsd->get_file_path(i); file=file.substr(6,file.length()); - if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_box->get_text()=="" || file.findn(search_box->get_text())!=-1)) { + if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_box->get_text().is_subsequence_ofi(file))) { TreeItem *ti = search_options->create_item(root); ti->set_text(0,file); |