Author Topic: find with multiple cursors  (Read 2017 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
find with multiple cursors
« on: August 03, 2016, 11:38:31 PM »
Given text file with:
CreateFile   C:\xxx\xxxxx\xxxx   asdfasdf asdf
CreateFile   C:\xxx\xxxxx\xxxx-7.5   asdfasdfasdf
CreateFile   C:\xxx\xxxxx\xxxx-7.0   asdfasdfasdfa
CreateFile   C:\xxx\xxx-xxxxxxx   sdfasdfsadfasdf
CreateFile   C:\xxx\xxxxxx-xxxxxxx   asdfasdfasdf


Search with
   Perl Regex: "^CreateFile\o:b\o:p\oz"
   Set Multiple Cursors is checked
   WrapAt B/E is not checked

#1: No matter where the cursor is in the file, it does a find-all - setting cursors and highlighting all matches in the file.
    I would expect it to only match from the current cursor position to the end of the buffer.

#2: Select several lines
   Find with <Current Selection>
   Set Multiple Cursors is checked
  • It does not set multiple cursors.
  • It reports the number of matches, and highlights the first match only.
  • If I also select "Highlight all matches", then it highlights all the matches that were in the selection, but still doesn't set multiple cursors.
#3: Repeat #1, but with RecordMacro on.
    After the find, end recording, and you get this:
        gui_find();
        if (find('^CreateFile\o:b\o:p\oz',"LI")) stop();
        if (find('^CreateFile\o:b\o:p\oz',"LI")) stop();

    Note that gui_find() is recorded, and FIND is repeated 2x.
    Playing back the macro doesn't get anything like what you would expect.

#4: The "|" option for "find" isn't documented.
The "@", "m", "x" and "v" find/search options also are missing documentation.

#5: Recording a macro with FIND - set Multiple Cursor doesn't include the "|" option in the macro.

#6: The documentation for "search()":
  Some options are bare:
      R   Interpret string as a SlickEdit r...
  While others are quoted:
      '+' (Default) Forward search.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6862
  • Hero Points: 528
Re: find with multiple cursors
« Reply #1 on: August 04, 2016, 01:59:35 AM »
#1 Working as designed. There are few options which are all treated like "List all occurrences". I do see the value in starting from the cursor though. One bug I see that you didn't mention is that "Wrap at beginning/end" should be disabled when "Highlight all matches", "Bookmark all matches', or "Set multiple cursors" is checked (just like "List all occurrences").

Using the find command with a selection and the | option will do what you need.

#2 Bug. Seems to only work with the find command.

#3 Bug

#4 @ is not supported (best not to use it). m, x, and v are documented unless I'm looking in the wrong place (type "help find command" on the slickedit command line).

#5 Bug

#6 Fixed for beta 3