Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stata 17 do-editor inconsistent behavior

    Dear All,

    I've just received Stata 17 and noticed the following inconsistent indication in the do-editor:

    Click image for larger version

Name:	do-editor.png
Views:	1
Size:	10.9 KB
ID:	1640705


    The title bar indicates (with a star) that the file has been modified, yet there is no undo capability.

    The file content is irrelevant, I've observed that with various files. The issue occurs in roughly this scenario:
    - open an earlier saved do-file;
    - do modifications to the code and run, several times;
    - undo changes by pressing the undo-arrow button.

    Expected - all changes are rolled back and the file status indicates "as saved - not modified".

    Additional information:
    - File is small, less than 10 lines of code.
    - Changes are small - tweaking some parameters.
    - Number of changes is small.

    I can't reproduce the issue consistently, but I have already encountered it several times. I am pretty sure I am doing everything same as I was doing in Stata 16.

    In relation to this, what are the limits of the UNDO-capability of Stata? How many changes? or how many lines in the buffer? Or perhaps time-bounds? Any details would help.

    Thank you, Sergiy



  • #2
    Does the file contain extended ASCII (non-Unicode) characters? I'd need to see your do files but my recollection is that if you open a file that contains extended ASCII characters, Stata prompts you to convert the characters to UTF8 (Unicode). There's a checkbox to always do the conversion and to not prompt the user in the future in the warning dialog that appears. The conversion can't be undone because it's part of the process for opening the file. So the document's status is "modified" because what's in the editor has been converted from what's on disk but that modification can't be undone which is why undo is disabled.
    -Chinh Nguyen

    Comment


    • #3
      Dear Chinh Nguyen (StataCorp) ,

      thank you very much for your attention to this matter.

      Files were created in Stata (unicode generations, 16 and 17), and do not contain any extended ASCII characters or BOM markers.

      I have since caught a 100% replaying scenario. It is using --> this file. (Clearly a minimal file for reproducing the problem, not a real-world file.)
      1. Double-click the file minimal.do
      2. When it opens in the do-editor, in the string constant, change "cccc" to "ccccdddd" (specifically by inserting "dddd" (4 keystrokes) after "cccc" and before the double-quote). Do not do any other changes.
      3. Press Ctrl+D to execute the new code.
      4. Press the back arrow to undo the change. The whole change done in #2 above is reverted. All 4 letters "dddd" disappear at once (this is ok).
      5. After "ccccdddd" turns back to "cccc", expected: "star" marker on file name disappears, actual: "star" marker on file name remains.
      Context: Stata/MP 17.0 for Windows (64-bit x86-64) Revision 14 Jun 2021

      Hope this helps.

      Best regards, Sergiy Radyakin


      Click image for larger version

Name:	minimal.png
Views:	1
Size:	35.6 KB
ID:	1640802


      Comment


      • #4
        I was able to reproduce the problem. It has to do with executing the unsaved do file and getting the modified state out of sync. This will be fixed in a future update.
        -Chinh Nguyen

        Comment


        • #5
          Dear Chinh Nguyen,

          thank you very much for addressing this problem.

          With best regards, Sergiy

          Comment

          Working...
          X