Page 1 of 1

Pasting multiline-comments does not auto format

Posted: Wed Apr 10, 2019 7:31 pm
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
#>

Re: Pasting multiline-comments does not auto format

Posted: Wed Apr 10, 2019 7:34 pm
by owinsloe
That didnt work too well....see attached image...
Untitled.jpg
Untitled.jpg (41.27 KiB) Viewed 2471 times

Re: Pasting multiline-comments does not auto format

Posted: Thu Apr 11, 2019 7:03 am
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.

Re: Pasting multiline-comments does not auto format

Posted: Thu Apr 11, 2019 3:01 pm
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

Re: Pasting multiline-comments does not auto format

Posted: Thu Apr 11, 2019 3:34 pm
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.

Re: Pasting multiline-comments does not auto format

Posted: Thu Apr 11, 2019 4:42 pm
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.

Re: Pasting multiline-comments does not auto format

Posted: Fri Apr 12, 2019 7:10 am
by davidc
I will ask the web team to investigate the issues.

Thank you for posting the request.

Re: Pasting multiline-comments does not auto format

Posted: Fri Apr 12, 2019 9:27 am
by davidc
They resolved the issue upload issue and you can now use a <pre> tag to preserve the formatting.

Re: Pasting multiline-comments does not auto format

Posted: Fri Apr 12, 2019 10:01 am
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.