Author Topic: add / customize commands in i-search  (Read 707 times)

rcordeau

  • Community Member
  • Posts: 16
  • Hero Points: 1
add / customize commands in i-search
« on: March 27, 2018, 11:08:40 pm »
Hi,
Is there a way to customize or add new commands to I-search? I would like to augment the ctrl-s "find next" with a "find next and add multiple cursor". I can't seem to find how to add a new keybinding to the I-search mode.

Thanks,
Rob

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1151
  • Hero Points: 107
Re: add / customize commands in i-search
« Reply #1 on: March 28, 2018, 01:22:51 pm »
Commands in i-search mode are not configurable, all events are handled in macro code specifically for i-search.  It is possible to modify and reload macro files in SlickEdit Pro, so it can be done but at your own risk.  I can add a feature request for adding multiple cursors in i-search mode to see if that can be added in future release.

rcordeau

  • Community Member
  • Posts: 16
  • Hero Points: 1
Re: add / customize commands in i-search
« Reply #2 on: March 28, 2018, 05:15:24 pm »
That would be really cool.  Thanks!

Graeme

  • Senior Community Member
  • Posts: 2117
  • Hero Points: 257
Re: add / customize commands in i-search
« Reply #3 on: March 29, 2018, 05:16:11 am »
Did you know you can do incremental searching from the mini find tool-window and you can set multiple cursors from there too.

rcordeau

  • Community Member
  • Posts: 16
  • Hero Points: 1
Re: add / customize commands in i-search
« Reply #4 on: April 09, 2018, 05:08:51 pm »
Any chance you could explain how that works? My mini find window can find text in files, but when that window is open, I cannot add multiple cursors unless I physically left-mouse-click in the source code editor window.

jporkkahtc

  • Senior Community Member
  • Posts: 1506
  • Hero Points: 129
  • Text
Re: add / customize commands in i-search
« Reply #5 on: April 09, 2018, 06:41:31 pm »
To customize incremental search, look in: C:\Program Files\SlickEdit Pro 22.0.2\macros\search.e

The keynames to search for are C_R, C_S, C_T, C_C, etc.
Easy to change them, I don't know how easy to add multiple cursors.
Though, look in Docsearch.e for how it does it - then you might be able to replicate the functionality in search.e

Graeme

  • Senior Community Member
  • Posts: 2117
  • Hero Points: 257
Re: add / customize commands in i-search
« Reply #6 on: April 09, 2018, 11:00:35 pm »
With the mini-find window active, click the downward pointing triangle next to the red cross (or use Alt F) and you get a menu  -  you can turn incremental search on and off etc. and Alt S is for set multiple cursors.  Don't miss the "find all" sub-menu.  It's not listed but Alt-L lists all occurrences in a search results window.  Press F1 for help and you can see all the key settings.  You can customize some key-bindings by fiddling with the following function in docsearch.e
Code: [Select]
void _document_search_form.'range-first-nonchar-key'-'all-range-last-nonchar-key'()
/*  'C-A'-'C-Z','c-s-a'-'c-s-z','c-a-a'-'c-a-z','a-a'-'a-z','a-s-a'-'a-s-z','c-0'-'c-9','c-s-0'-'c-s-9',\
                           'c-a-0'-'c-a-9','a-0'-'a-9','M-A'-'M-Z','M-0'-'M-9','S-M-A'-'S-M-Z','S-M-0'-'S-M-9','C-S- ',\
                            F1-F12,C_F1-C_F12,A_F1-A_F12,S_F1-S_F12,'c-a-s-a'-'c-a-s-z','c-a-s-0'-'s-m-9'()
 */
{

rcordeau

  • Community Member
  • Posts: 16
  • Hero Points: 1
Re: add / customize commands in i-search
« Reply #7 on: June 15, 2018, 06:46:38 pm »
Thanks for the replies. The mini find window is a decent option, but here is the issue. Say I want to just highlight a section of my code to search in. Great, no problem. The mini-find window will just search in there for what I'm looking for. Say it finds just the 5 occurrences of the text that I want. Awesome. Now I want to add multiple cursors for just those 5 occurrences, so I hit "Alt+S". Whoops - it just added multiple cursors for the entire file and all 100+ occurrences of what I was searching for. I am just asking if Slick can add this feature in the next release/update. I think other people might benefit from it, but perhaps I'm wrong.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1151
  • Hero Points: 107
Re: add / customize commands in i-search
« Reply #8 on: June 15, 2018, 07:00:09 pm »
I think you uncovered a bug there.  Search in selection with Mini-Find should work with multiple cursors, at least it is supposed to.  Let me investigate that, it should be hotfixable.