Pasting multiline-comments does not auto format

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
owinsloe
Posts: 103
Joined: Tue Jul 10, 2012 10:37 am

Pasting multiline-comments does not auto format

Post by owinsloe »

Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.160
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.17763.0

Pasting multiline-comments does not format correctly with the "Automatically format on paste" setting on.

The <# tag will paste from the current cursor position then the following text left-aligns.

eg.

}
<#
Powershell Studio
is cool when not pasting
#>

if ($BinPath)
{
<#
Powershell Studio
is cool when not pasting
#>
if ((test-path $BinPath))
{
<#
Powershell Studio
is cool when not pasting
#>

User avatar
owinsloe
Posts: 103
Joined: Tue Jul 10, 2012 10:37 am

Re: Pasting multiline-comments does not auto format

Post by owinsloe »

That didnt work too well....see attached image...
Untitled.jpg
Untitled.jpg (41.27 KiB) Viewed 2478 times

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Pasting multiline-comments does not auto format

Post by davidc »

When it comes to multi-line comments, PowerShell Studio formatting does not modify the white space. So, if you paste at the end of a line, it will begin insertion at the point and leave it as is.
David
SAPIEN Technologies, Inc.

User avatar
owinsloe
Posts: 103
Joined: Tue Jul 10, 2012 10:37 am

Re: Pasting multiline-comments does not auto format

Post by owinsloe »

Hi David,
Thanks for responding. Yes, that is correct...but could it?

ie. If PSS sees the '<#' open tag then align all newlines below this point until '#>' is reached.

Would I need to raise a new feature suggestion or is there some underlying behavior that would prevent PSS performing this function?

Cheers

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Pasting multiline-comments does not auto format

Post by davidc »

Yes, I highly recommend posting any feature request you have here:

https://www.sapien.com/requests

Try to include the formatting the behavior you wish to see applied and we will see what we can do.
David
SAPIEN Technologies, Inc.

User avatar
owinsloe
Posts: 103
Joined: Tue Jul 10, 2012 10:37 am

Re: Pasting multiline-comments does not auto format

Post by owinsloe »

David, I posted a link for a NFS using the link you supplied but was a bit of a disaster. When I posted my pre-formatted text which looked fine, everything left aligned so the post doesnt make sense and I can not delete or edit.

I also tried to upload an image file but was getting an error (looked like permissions) and the upload would not work.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Pasting multiline-comments does not auto format

Post by davidc »

I will ask the web team to investigate the issues.

Thank you for posting the request.
David
SAPIEN Technologies, Inc.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Pasting multiline-comments does not auto format

Post by davidc »

They resolved the issue upload issue and you can now use a <pre> tag to preserve the formatting.
David
SAPIEN Technologies, Inc.

User avatar
J A Reif
Posts: 213
Joined: Mon Jan 14, 2013 9:43 am

Re: Pasting multiline-comments does not auto format

Post by J A Reif »

For best results using the <pre> tag, enter an empty paragraph first, change it to PRE using the Formats->Blocks drop-down and then paste your pre-formatted text.
June Alane Reif
SAPIEN Technologies, Inc.