Length limit of watch variable expression

Does the expression of a variable watch have a length limit in AltUI? If so, what is it? I tried to use a longer expression and the submit appeared to take it, but then I could see an error in the log file complaining about syntax. Going back in the GUI I could see that it was truncated. At a minimum it would be nice if AltUI would tell you that you have exceeded the limit. Better would be to also extend it a bit.

For the moment I have switched to a standard variable watch where I can put an arbitrary sized function. Maybe I should leave it there as it doesn’t seem that the expression box is designed for more elaborate coding.

It’s a bit worse than I originally thought. I am not able to delete the variable watches. I can press the delete icon and it appears to delete the watch and I press ‘submit’, but if I then come back to the scene, the broken watch is still there. I’ll see if I can delete it from the watch table.

Can’t delete it from the watch table. The GUI only shows part of the expression, but I can see in the user_data.json that the full expression is there in the VariablesToWatch.

I think I see the bug. I used a # to get the size of an array and I suspect this wasn’t escaped properly. That # is exactly where the expression is cut off. I edited this out in the AltUI variable directly. Still couldn’t delete the watch. But now I was able to edit and save the expression in the scene page and made it much smaller. And finally I could delete the watch.

Problem solved. Recommendation: don’t use a long expression, and don’t include a # anywhere in it.