This appears to be part of a larger issue in that the 2.x IDE GUI is treating changes to sketches from library example sketches differently than non library sketches.
If the sketch is under a library example, it appears that the 2.x IDE GUI no longer pulls in changes made to the sketch when it has been modified using an external editor, nor will it save changes made to the sketch when verifying/building the sketch.
There should be no need to treat changes to the sketch files differently depending on where the sketch lives.
i.e. if the sketch file in the IDE GUI has been changed/modified, the IDE should pull in and use the updated file.
The current 2.x behavior is not the behavior of 1.x when selecting to use an external editor and the current 2.x behavior actually malfunctions and breaks certain work flows.
For example a developer developing an Arduino library can no longer use an external editor when developing the examples for a library as the 2.x IDE will silently not pull in the changes being made to the example sketch file when using an external editor and using the IDE GUI to build the example.
I guess I need to bug this on github.
Here is a bit more about behavior when using an external behavior
The 2.x IDE GUI has a different behavior depending on where the sketch lives and the IDE does not support using an external editor with the sketch involved if it is an example within a library.
i.e. Using an external editor with IDE 2.x GUI does not seem to work when the sketch involved is part of a library example.
For example, (a sketch that is not part of a library)
If the sketch lives at {sketchbook}/foo/foo.ino
and is pulled into the IDE GUI using:
[File]->Sketchbook->foo
When using an external editor on the file foo.ino any changes will show up in the 2.x IDE GUI which is as expected.
However, when the sketch is under a library as an example, the 2.x IDE is not pulling in changes being made using an external editor which is not as expected.
(1.x did not have this issue)
For Example (a sketch that is part of a library)
if the sketch lives at {sketchbook}/libraries/libnamedfoo->examples/foo/foo.ino
and is pulled into the 2.x IDE GUI using:
[File]->Examples->libnamedfoo->foo
When using an external editor on the file foo.ino the 2.x IDE GUI will not pull in the modified file. It will continue to use the original file.
This seems like it was intentionally coded this way vs a bug.
It doesn't make sense.
The 2.x IDE should work the same way with respect to sketch file changes from external editors regardless of where the sketch lives which is what the 1.x IDE did.
NOTE:
In case it matters, I'm using Linux Mint 21 Mate with an IDE installed from a zip file.
--- bill