Author Topic: New feature  (Read 6468 times)

Offline dje

  • Lives here!
  • ****
  • Posts: 682
New feature
« on: June 10, 2007, 11:26:44 pm »
Hi !

I've submitted feature 3492 to be able to use filespec (* and ?) in Goto file/function dialogs.

That way, you can type in the Goto file dialog
tod*w
to match
plugins\todo\todolistview.cpp
in codeblocks.cbp

Simple, efficient, no side effect, enjoy !!  8)

The patch 2046 is here

Code
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]);
  }

Dje

Offline pauliusz

  • Multiple posting newcomer
  • *
  • Posts: 73
Re: New feature
« Reply #1 on: June 11, 2007, 02:22:18 am »
Simple, efficient, no side effect, enjoy !!  8)

Actually I would prefer to add '*' in the beginning and end of the search string by myself.

Offline dje

  • Lives here!
  • ****
  • Posts: 682
Re: New feature
« Reply #2 on: June 11, 2007, 08:10:29 am »
Hi !

I understand, I would have done it this way too but I thought it was better being consistent with actual behaviour; maybe I could add an option on a configuration panel ?

Dje

Offline dje

  • Lives here!
  • ****
  • Posts: 682
Re: New feature
« Reply #3 on: June 26, 2007, 12:18:58 am »
Hi !

Is there any core developer to apply the patch or reject the feature please ??

Thanks,

Dje

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: New feature
« Reply #4 on: June 26, 2007, 01:53:49 am »
Sorry, I'm currently busy trying to fix a segfault. But don't worry, I'm sure your feature will get accepted... eventually :(

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: New feature
« Reply #5 on: June 26, 2007, 07:29:55 am »
I'll try to have a look at it today.