Patch #2046 2007-06-10 21:17

dje

3492 : Goto file/function dialogs evolution
Download
2046-3492_Goto_file.patch (962 bytes)
Category
Application::FeatureAdd
Status
Accepted
Close date
2007-07-25 11:45
Assigned to
 
Index: incrementalselectlistdlg.cpp
===================================================================
--- incrementalselectlistdlg.cpp    (revision 4078)
+++ incrementalselectlistdlg.cpp    (working copy)
@@ -116,13 +116,17 @@
 void IncrementalSelectListDlg::FillList()
 {
     Freeze();
-    wxString search = m_Text->GetValue().Lower();
+
+    // We put a star before and after pattern to find search expression everywhere in path
+    wxString search(wxT("*") + m_Text->GetValue().Lower() + wxT("*"));
+
     wxArrayString result;
     //Manager::Get()->GetMessageManager()->Log(mltDevDebug, "FillList(): '%s'", search.c_str());
     m_List->Clear();
     for (unsigned int i = 0; i < m_Items.GetCount(); ++i)
     {
-        if (search.IsEmpty() || m_Items[i].Lower().Find(search) != wxNOT_FOUND)
+        // 2 for before and after stars =~ empty string
+        if ((search.Length()==2) || m_Items[i].Lower().Matches(search.c_str()))
             result.Add(m_Items[i]);
 //            m_List->Append(m_Items[i]);
     }
mandrav 2007-07-03 09:45

Hmm, what is this supposed to do? The incremental search field in those dialogs already looks for matches anywhere inside the strings...

dje 2007-07-03 09:54

I work on a too big project with very long path names.

For now, the dialog triggers everything containing the string.

I often need to type two parts of filename to 'high-speed' match the one I'm looking for.

For example, I'd like to enter

mes*man

to match

messagesmanager.cpp

mandrav 2007-07-25 11:45

Patch applied.