Author Topic: Improving "Find Symbol" (12.0.2, XP)  (Read 4315 times)

RobFreundlich

  • Community Member
  • Posts: 47
  • Hero Points: 2
Improving "Find Symbol" (12.0.2, XP)
« on: August 24, 2007, 03:34:16 pm »
I really like the new Find Symbol windowin v12.  But I have two complaints about it:

1. When you bring it up, the text in the text field isn't select.  So when you start typing, you're prepending to the last find, not replacing it.

2. If you hit ENTER when there's only one thing in the list, and the list hasn't yet been updated to match what you typed, you end up in the wrong place.

I've fixed these two problems and offer the fixes to anyone who wants them.  In tagfind.e, you'll find the following two functions.  Change them as I've done (RSF is me).

Code: [Select]
/**
 * If they press "Enter", then jump to the first match
 */
void ctl_search_for.enter()
{
   if (ctl_symbols._TreeGetFirstChildIndex(TREE_ROOT_INDEX) < 0) {
      updateSearchResultsNoDelay();
   } else if (ctl_symbols._TreeGetNumChildren(TREE_ROOT_INDEX) == 1) {
      // RSF - If the one symbol matches, go to it.  Otherwise, update
      // the symbols list and give it focus
      VS_TAG_BROWSE_INFO cm;
      int status = getSelectedSymbol(cm);

      if (cm.member_name == p_text) {
         call_event(ctl_goto_symbol.p_window_id, LBUTTON_UP);
         maybeHideFindSymbol();
      } else {
         updateSearchResultsNoDelay();
         ctl_symbols._set_focus();
      }
   } else {
      ctl_symbols._set_focus();
   }
}

/**
 * When the search list gets focus, update it's history information
 */
void ctl_search_for.on_got_focus()
{
   ctl_search_for.p_cb_list_box._lbclear();
   ctl_search_for._retrieve_list();

   // RSF
   ctl_search_for._set_sel(1, length(p_text) + 1);
}

SlickEdit team: can these changes be folded back into the codebase (perhaps guarded by a couple of options, since I'm sure not everyone wants this to work like I do)?

xj97

  • Community Member
  • Posts: 19
  • Hero Points: 1
Re: Improving "Find Symbol" (12.0.2, XP)
« Reply #1 on: June 24, 2009, 03:15:44 pm »
I would really love to see item #1 on Rob's list, either as standard behavior or as an option.  Maybe I'm missing the option somewhere?

About 90% of the time when I hit CTRL+F (my shortcut for activating the Find Symbol pane), I have to hit HOME, SHIFT+END, and then start typing what I want.

Maybe I'm missing an easier way?

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Improving "Find Symbol" (12.0.2, XP)
« Reply #2 on: June 24, 2009, 07:57:23 pm »
Both items have been fixed for v14.0.2, coming *soon*.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Improving "Find Symbol" (12.0.2, XP)
« Reply #3 on: June 24, 2009, 08:02:31 pm »
Re: #1 -- If the Find Symbol toolbar is autohide or is not docked, then the previous lookup string is selected (as desired) when you activate the toolbar.  If the Find Symbol toolbar is docked, then the previous lookup string is not selected when the toolbar is activated.

If undocking it is an option for you, that may be a workaround in the meantime.

xj97

  • Community Member
  • Posts: 19
  • Hero Points: 1
Re: Improving "Find Symbol" (12.0.2, XP)
« Reply #4 on: June 24, 2009, 09:23:33 pm »
Chrisant-  Thanks for the tips!  But yeah I'm kind of "attached" (ha ha) to having it docked in my current setup.

ScottW - Great to hear, can't wait for it   ;D

Thanks-
B

xj97

  • Community Member
  • Posts: 19
  • Hero Points: 1
Re: Improving "Find Symbol" (12.0.2, XP)
« Reply #5 on: July 10, 2009, 03:12:09 pm »
Just grabbed 14.0.2.2 and this is working just as I'd hoped, thanks!