Strange text behaviour

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.
This topic is 3 years and 10 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.
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Strange text behaviour

Post by Lembasts »

Product, version and build: PSS 5.7.174
32 or 64 bit version of product:64
Operating system:win10 1909
32 or 64 bit OS:64

Im getting some strange behaviour in a few of my function calls. For example here's what it looks like normally (pss1):
pss1.jpg
pss1.jpg (8.26 KiB) Viewed 2708 times
Note that it appears that there are two or more spaces between the function call and the parameter when there is in fact only one.

When I place my cursor to the right of the 't' in Add-SQLRequest and left click, here's what it looks like (pss2):
pss2.jpg
pss2.jpg (7.96 KiB) Viewed 2708 times
When I place my cursor at the left of 'Add' and hold and start dragging as if to select it looks like this (pss3):
pss3.jpg
pss3.jpg (9.18 KiB) Viewed 2708 times
Note the space between the 'R' and 'e'.
This only happens on a small handful of function calls. Most behave normally as you would expect.
To fix this I place my cursor just to the left of the '$', hit backspace and then the space bar. The behaviour goes away.
However if I fix it and save then re-open, the problem comes back.
It doesnt affect the function call - its just weird.
Thanks
David
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Strange text behaviour

Post by Alexander Riedel »

I have seen something like this many many years ago in (a galaxy far far ...never mind) another editor.
Back then it was a weird character or character sequence that somehow got inserted into the file and made it appear that there was an extra space. It was not a printable character, so the editor just rendered it as white space. I cannot know if this is something similar, but it would help if you could zip (important!) the file in question and send it to us or upload it.
I'd like to look at it with a hex viewer and check what's going on. It obviously would be helpful if you could point out the exact places where you see that behavior.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Strange text behaviour

Post by Lembasts »

Thanks for your prompt reply. I also thought it was some weird hex character but that doesnt quite explain that when I fix it/save/reopen it re-appears.
Unfortunately I work for a secretive govt department and they not allow code of any sort outside our network.
If you can suggest a free hex editor, Ill take a look myself and get back to you.
Cheers
David
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Strange text behaviour

Post by Alexander Riedel »

PrimalScript. The trial will do it.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Strange text behaviour

Post by Lembasts »

This is strange. I opened the psf file that has a problem as binary in primalscript. The problem 'space' character in primalscript is a normal hex '20'. IOW it all looks fine in Primalscript but goes wonky when opened in PS Studio.
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Strange text behaviour

Post by Lembasts »

I just saw something that may explain this. I noticed that the weird behaviour was occurring on some function calls only. I have a file for all my projects called commonfunctions.ps1 where these functions reside. What I noticed was that when I go to type one of these 'weird' functions, the intellisense displays two versions of the same name - one with red cube thing next to it and one with a blue rectangle thing with a white circle. Im assuming that the red-cube means it comes from my commonfunctions file so I wondered where its getting the other one. As it happens I also have a PSM1 module file with the function of the same name. So PS studio must have enumerated that and then started to exhibit this weird behaviour. Thing is that my psm1 file has been there forever and its only recently that I noticed this behaviour.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Strange text behaviour

Post by Alexander Riedel »

Hmm, interesting. I will make sure the team looks into this. Thanks.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
stephanied
Posts: 13
Last visit: Thu Apr 08, 2021 8:55 am

Re: Strange text behaviour

Post by stephanied »

We are working on replicating this behavior. I have attached a sample project, could you tell me what is different about this setup compared to yours?

Thanks,

Stephanie Dennis
SAPIEN Technologies, Inc.
Attachments
StrangeForumTest1.zip
(34.84 KiB) Downloaded 98 times
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Strange text behaviour

Post by Lembasts »

With your attached project when you start typing the function 'write-stringtest1', the intellisense only lists one version of that function where mine lists two.
The difference probably is that my psm1 file is not in the project but is in a module located within c:\windows\system32\windowspowershell\v1.0\mymodule
Also, when I look at the object browser I can see my module.
Thanks
David
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Strange text behaviour

Post by Lembasts »

Are you looking to fix this or should I change the names of my functions so that they are not duplicated between the commonfunctions file I use in my project and the PSM1 file in the standard module location?
This topic is 3 years and 10 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.