I didn’t have this issue on previous Unity versions. Sometimes, when I double click a script in Project window or click a stacktrace line in Console window, Visual Studio freezes for a few seconds. When it finishes whatever it’s doing, it auto-saves all my open scripts (if they had any unsaved changes) and the “changed line indicators” in all my scripts are gone (yellow indicators for unsaved lines and green indicators for modified lines).
Using 2021.3.18f1 with Visual Studio Editor 2.0.17 package.