[PSS 2016] Region Labels

Post feature requests, product enhancement ideas, and other product-specific suggestions here. Do not post bug reports.
Forum rules
Do not post any licensing information in this forum.
This topic is 7 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

[PSS 2016] Region Labels

Post by Bosparan »

Hi,

today I come with a really minor feature request:

When wrapping some code in a region ("CTRL" + "R"), it prompts me to assign a label at the top, resulting in something like this:
  1. #region Test
  2. $foo = "bar"
  3. #endregion
Quite convenient. However, our coding practices require the endregion-marker to be labeled the same (since regions can be lengthy and sometimes you just scroll up, not down).
Would you mind adding the same label on the endregion-marker as well, leading to a result such as this:
  1. #region Test
  2. $foo = "bar"
  3. #endregion Test
?
Given that it's already quite possible in your snippet system to set several pieces of text during insertion dynamically, so that editing one means also editing the other you appear to already having the tools ready for that ...

Cheers,
Bosparan
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: [PSS 2016] Region Labels

Post by davidc »

Ctrl + R command triggers the Region snippet. If you create your own snippet with the same shortcut, it should use that instead.
David
SAPIEN Technologies, Inc.
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

Re: [PSS 2016] Region Labels

Post by Bosparan »

... ... ...
... ... ...
... ... ...
and I even mentioned the snippet system myself :?
Thanks for pointing that out David, guess I'll just do that.
I think it's good default though, so it might be an idea to update the original snippet as well, while I get around to pirate *cough* ... ehm, use the inspiration of your snippet to create my custom one right now :)

Cheers
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

Re: [PSS 2016] Region Labels

Post by Bosparan »

davidc wrote:Ctrl + R command triggers the Region snippet. If you create your own snippet with the same shortcut, it should use that instead.
Tried it out now: The keybind still uses your snippet (It is named exactly the same - "Region" - and is located in my user folder for snippets).
I could replace your snippet of course, but that will return on the next update ...

I guess that means I'll have to add another feature request ;) :

Override Sapien Snippets
Allow overriding official Snippets for keybind and from either the Custom Snippet folder or the User Snippet folders:
- To Override the Snippet, it must be named exactly the same and have the same Shortcut.
- A Snippet in the Custom Snippet folder can override Snippets in the Sapien Snippet folder.
- A Snippet in the User Snippet folder can override Snippets in both the Custom Folder as well as the Sapien Snippet folder.

Cheers,
Bosparan
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: [PSS 2016] Region Labels

Post by davidc »

I tested it on my end and it seems to work just fine. Please make sure you set the snippets shortcut field to "region". The snippet name doesn't determine the shortcut.

As for the snippet ordering, they are as follows:

1. Custom
2. User
3. Preset

I can see the case where User should take precedence over custom, so this might change.

FYI, we updated the preset snippet to include the endregion title.
David
SAPIEN Technologies, Inc.
This topic is 7 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked