code
code copied to clipboard
Compiling in a terminal causes "modified by external application"
When the option 'Preferences' -> 'Behavior' -> 'Save files when changed' is not selected, compiling an opened c source file in a terminal causes a notification "<filename> was modified in an external application. Do you want to load it again or continue your editing?" to be shown. Selecting Continue will cause the notification to be shown again until Load is chosen.
If the option 'Preferences' -> 'Behavior' -> 'Save files when changed' is selected, the editor jumps to the top of the file.
The compilation command is:
../opt/mingw32ce/bin/arm-mingw32ce-gcc -x c <filename> -L <libpath> -l <lib> -mno-thumb-interwork -o <outputfile>
which shouldn't modify the source file (and doesn't according to the output from ls -lortha).
Screenshot:

Attached auditd watch log for the file. The log format is not too familiar to me, but it appears io.elementary.code is the only one changing the file. There seems to be many operations performed (create, delete, rename), some successful, some not.
There does appear to be a flaw in the way the document is being checked for external changes I'll investigate.
@tkarhun There have been substantial changes to this part of the code in the latest version and I couldn't produce unexpected behaviour with a very simple C program. I cannot exactly reproduce the conditions where you experienced the issue unfortunately.
If you are able could you confirm (or otherwise) the issue with the latest version of Code?