SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: rcordeau on March 27, 2018, 11:08:40 PM

Title: add / customize commands in i-search
Post by: rcordeau 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
Title: Re: add / customize commands in i-search
Post by: Lee 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.
Title: Re: add / customize commands in i-search
Post by: rcordeau on March 28, 2018, 05:15:24 PM
That would be really cool.  Thanks!
Title: Re: add / customize commands in i-search
Post by: Graeme 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.
Title: Re: add / customize commands in i-search
Post by: rcordeau 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.
Title: Re: add / customize commands in i-search
Post by: jporkkahtc 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
Title: Re: add / customize commands in i-search
Post by: Graeme 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'()
 */
{
Title: Re: add / customize commands in i-search
Post by: rcordeau 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.
Title: Re: add / customize commands in i-search
Post by: Lee 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.