Text Editor objects closing within 15 seconds without any action

With the exception of the Field/Variable mode with a field name, any Text Editor object is automatically closed within 15 seconds if left open after any editing is made. Consequently, any changes made in formula mode will be lost. However, the editor will remain open as long as no editing is made.
Interestingly, this issue does not happen in clone windows. If opening the form as a clone window for the first time does not solve the problem, closing and reopening the form or opening the closed editor again will make the bug disapper.

Is this a known bug? Why 15 seconds? It happens in non shared files.

This is not a known bug. I have no idea what you are talking about. There have been no other reports of this, and I cannot duplicate this problem.

Are you sure it’s not a shared file you’re describing?

This screen recording of a simple file is intended for two posts: Use Field Editing Attributes and Auto Capitalization (posted 02/03/25) and the current one (posted 02/07/25).
While working on my ProcEdit file for editing procedures, I noticed that the Text Editor would close unexpectedly while I was editing the text. This occurrence resulted in the loss of all my changes.
I have examined all timeout settings, but none of them appear to apply to non-shared files. Given the frequency of this issue, I have seriously checked the occurrences and shared them on the forum.

It is important to note that the video has not been edited in any way, and no other actions were taken besides opening the Text Editors and typing.

TESObugs.mov: TESObugs.mov - Google Drive

It’s not exactly 15 seconds, but it appears that Apple’s auto-save is kicking in and closing the editor. I don’t think this can be disabled. I’m not sure why auto-save is kicking in, since the document hasn’t actually been modified yet, but it is. (Addendum - now I can’t duplicate this, but I definitely got it to happen once.)

Normally this is fine, but you have purposefully written code to make sure that the changes aren’t saved in this situation. The second line of your code is:

if info("keyboard")="" rtn endif

When auto-save ends the editing (or if you click outside of the text editor, which also ends editing), this will be triggered, and your changes will be lost.

In fact, the whole first part of your code should be removed. The code should only be:

First = firstword(TextEditingResult)
Last = lastword(TextEditingResult)

Ok, I think you were using focusobject, mousedown etc to try to see what type of operation triggered the procedure. Then you were trying to fix the bug that Field Editing Attributes doesn’t work in Formula mode. That bug has been fixed, so you won’t need this, but in any case, there is an official, approved way to trigger different code depending on what has happened, as explained in the documentation.

So the “correct” way to do what you were trying to do is:

return

finishEditing:
    startdatabasechange "CurrentRecord","Edit Name"
    First = firstword(TextEditingResult)
    Last = lastword(TextEditingResult)
    return

mostKeys:
    local s,e,idata
    let allowedChars = "AZaz. "  // I didn't feel like typing in the complete list, knock yourself out
    activeobjectaction "getselection",s,e
    activeobjectaction "gettext",idata
    if upperword(stripchar(idata,allowedChars))<>idata
        activeobjectaction "settext",upperword(stripchar(idata,allowedChars))
        activeobjectaction "setselection",s,e
    endif
    return

When I say that this version is “correct”, I mean that it will never lose data no matter how you terminate editing, including auto-save or clicking. I’ve also added the startdatabasechange statement so that editing can be undone.

You might want to use everyKeys instead of mostKeys, but I think mostKeys would be better. In any case, that entire section of this code will be unnecessary once the next version of Panorama X comes out which fixes the Field Editing Attributes problem.

The left Name editor was identical to the screenshot from Panorama Help, while the right Name editor was to highlight the issue with ‘Use Field Editing Attributes and Auto Cap’.
Thank you for fixing the bug!

To me it happens always in about 15 seconds. As soon as I start typing ’ – Edited’ is added in the window title bar, so Apple’s auto-save is kicking in. That explains what happens. However, why does the editor close in about 15 seconds?
Occasionally, the editor does not close, making it challenging to discern the pattern, but in some editors it happens every time. Again, this never happens in clone windows, and the window title bar remains unchanged during data editing.

Auto save closes any open editor windows. If it didn’t, your edited content wouldn’t be saved. I think in the past Panorama X didn’t close the editor, and there were complaints about lost data.

I think clone windows are not hooked into the NSDocument structure in the same way. Now that you have mentioned it, that may be a bug, though if so, it may be extremely difficult to rectify.

I’m glad you included that, otherwise I would have had no idea what was going on. You certainly didn’t get that code out of the help. Honestly, it would have been easier if you had just pasted the code into a forum post rather than doing a video.

What happens is entirely opposite. It is like undoing the editing by pressing esc key, so all the changes are gone. Otherwise I wouldn’t even have bothered reporting it.
This does not happen in any other applications that I am aware of, including Panorama 6.

Aren’t Text Editor objects supposed to be closed only by any termination key, esc key, or clicking outside of the object? Any editing is temporary until the object is closed properly.

“Except for Field/Variable mode with a field, any Text Editor object will be closed within 15 seconds if left open after any editing is made.”
As I have previously mentioned, this does not occur in Field mode at all. The object remains open until the user closes it, which is a normal behavior.
If an unexpectedly closed editor after extensive editing results in the loss of changes, it is imperative to address the issue. I hope that this behavior may also be fixed when the ‘Use Field Editing Attributes and Auto Cap’ option bug is fixed.

Once more, the Name editor on the left side of the video is straight from the Panorama Help. My intention was to demonstrate the precise sequence of events, and a video format is the most suitable medium to capture the unexpected closure of Text Editor objects within a 15 second interval.