Author Topic: selective display regions + defs view  (Read 193 times)

IkerAriz

  • Senior Community Member
  • Posts: 153
  • Hero Points: 6
selective display regions + defs view
« on: April 27, 2021, 07:12:35 pm »
Hello all,

Is there a way to get regions defined using "search text" in selective display to show up in the defs view? (there was some talk of this in a 2011 thread titled "C# regions and defs view" but no updates since then).

Regards,
Iker

« Last Edit: April 28, 2021, 12:42:00 pm by IkerAriz »

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3231
  • Hero Points: 459
Re: selective display regions + defs view
« Reply #1 on: April 27, 2021, 09:18:31 pm »
There is no option to do that, but if you want to have a list of search matches, you could search within the current buffer and select "List all occurrences", then right click on the search results and sent them to the References tool window, or you could search and set bookmarks on all of the search matches.

IkerAriz

  • Senior Community Member
  • Posts: 153
  • Hero Points: 6
Re: selective display regions + defs view
« Reply #2 on: April 28, 2021, 01:11:54 pm »
Thanks Dennis. I couldn't try "send to references" as I'm on v23 so I gave the bookmark suggestion a try. It almost did the job but for a couple of issues:
  • One has to bookmark each search result one at a time which is tedious when a file has many regions (30+ in my case).
  • The Text column of the bookmarks window which has the name of the region is the last one and fixed at that position (I couldn't find any way to move it). I usually keep a relatively narrow sidebar panel so the useful info is hidden. See attached screenshot.

Iker

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3231
  • Hero Points: 459
Re: selective display regions + defs view
« Reply #3 on: April 28, 2021, 01:42:09 pm »
I was referring to using the Find and Replace tool window and selecting "Bookmark all matches"

You can click and drag the header columns to resize the columns in the Bookmarks tool window, the tree control also has a horizontal scroll bar, so you could scroll the text into view.

IkerAriz

  • Senior Community Member
  • Posts: 153
  • Hero Points: 6
Re: selective display regions + defs view
« Reply #4 on: April 30, 2021, 02:01:46 pm »
Thanks again. The "bookmark all" option worked well. However, the results in the bookmarks window are still rough as shown in the attached screenshot. Ie:
  • The initial columns still take up a lot of room even when resized to their minimum.
  • The horizontal scrollbar doesn't show up to allow centering the text column content into view.
Is there a way to get a Find regex to match/display only a capture group? (in order to suppress the leading "<!-- #region" prefix)

Iker

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5736
  • Hero Points: 458
Re: selective display regions + defs view
« Reply #5 on: April 30, 2021, 02:31:54 pm »
The "List matches only" option reduces the line output to just the text that was matched (not obvious). If that's too much, try using a regex with lookbehind   (ex. " (?<=def)main" ). SlickEdit supports variable length look behind. As far as I know, there's no other regex engine which supports variable length look behind. It's awesome when you need it.

IkerAriz

  • Senior Community Member
  • Posts: 153
  • Hero Points: 6
Re: selective display regions + defs view
« Reply #6 on: April 30, 2021, 03:56:35 pm »
Thanks Clark. I tried using lookbehind but unfortunately the reduced output is limited to the search results window. The Text column of the bookmarks window still displays the entire line (see attached screenshot).

Iker

IkerAriz

  • Senior Community Member
  • Posts: 153
  • Hero Points: 6
Re: selective display regions + defs view
« Reply #7 on: May 04, 2021, 04:26:18 pm »
The bookmarks solution coupled with a custom selective display to fold regions makes for a pretty good solution but for the noisiness of the bookmarks window. Any chance an upcoming update could include support for hiding columns in the bookmark window and showing just the matching text in the "Text" column?

Thanks,
Iker