Built-in editor: hidden NULL characters

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Post Reply
Message
Author
Zeus
Posts: 5
Joined: Thu May 18, 2023 5:49 am

Built-in editor: hidden NULL characters

#1 Post by Zeus »

Today I've spent close to an hour trying to figure out why my instrument was not working and then why AM (or rather Lua) rejected my script. It turned out, the text had a NULL character in it:
AM3.png
AM3.png (4.07 KiB) Viewed 1539 times
It seems to happen when pasting text into the built-in editor, but only on some conditions, not always. I don't know when exactly.

Now, I understand the built-in editor is barely functional, and improving it would be a big feature-request. There is a good reason there is a big button to open the script in an external editor. Yet, I tend to avoid doing that except for major edits (partly because of the editor mistreatment of tabs, which I much prefer to use). In any case, small corrections are easier to make right in the editor.

But this bug, inserting the NULL accidentally, is really dangerous. It's insidious because it's invisible in the editor. Apart from making the script non-functional, some external editors (that are less capable than Notepad++) may still hide it or worse, truncate the text there. I hope it can be fixed...

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Built-in editor: hidden NULL characters

#2 Post by Ralph »

I have never seen this happen to anyone since the editor was added to Air Manager, version 3.0 I think, so in 4 or 5 years. I'm not sure how you did this...
And apart from that, there's going to be a new editor in an upcoming version, so not really something to worry about.

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: Built-in editor: hidden NULL characters

#3 Post by Corjan »

Hi,


Isn't this just weird text that you are trying to add.
I would be looking at the source of the copy/paste action.

Having a NUL character in the text will probably only make the runner use all the text before the NUL chacterter, and ignore everything after.
Just speculation though, it simply shouldn't be there in the beginning :)


Corjan

Zeus
Posts: 5
Joined: Thu May 18, 2023 5:49 am

Re: Built-in editor: hidden NULL characters

#4 Post by Zeus »

Well, if we expect a new editor (which would be very welcome), there is no point pursuing the problem much.

But I can assure it happened to me several times, and all while copy-pasting either within the editor, or from the browser. (Hard to say exactly because I spot it much later).

Post Reply