Here's a sample of one that shouldn't be happening since I've disabled undo state being set for almost all UI and navigation changes in preferences.
Code:
<TRACK {D5E5E246-92D3-3B43-9F2A-08B2DF93D78B}
...
SHOWINMIX 1 0.660377 0.5 1 0.5 0 -1 0
SEL 1
REC 0 5088 0 2 0 0 0
VU 2
- TRACKHEIGHT 16 0 0 0 -1 0
+ TRACKHEIGHT 31 0 0 0 -1 0
INQ 0 0 0 0.5 100 0 0 100
NCHAN 4
FX 1
Looking at the undo state info, the case is the same for what looks like every track in my project (although, the values for the -/+ TRACKHEIGHT are different for a lot of the tracks). This time, the "ReaScript: Run" undo state occurred after I did a marquee item selection, and ran the script "X-Raym_Select only tracks of selected items.lua"
Considering these actions only select items and then the tracks associated with them, I have no idea why the project state is showing track height changes when there were none that occurred.
However, later on, I saw another "ReaScript: Run" in the undo history. Again, the state seems to have been changed for what appears to be every track in the project.
Code:
<TRACK {6359A8A0-8FB5-9C4B-9CAA-BF26E98E38FE}
...
PLAYOFFS 0 1
ISBUS 0 0
BUSCOMP 0 0 0 0 0
SHOWINMIX 1 0.660377 0.5 1 0.5 0 -1 0
- SEL 0
+ SEL 1
REC 0 5088 0 2 0 0 0
VU 2
TRACKHEIGHT 16 0 0 0 -1 0
Coincidentally, this time it was the -/+ SEL change undo state issue.
So now I'm wondering: if a script runs using reaper.defer(), does this leave the script running passively somehow until the next script/function is run
without being deferred, at which point the deferred function/script changes are pushed to the project file (or simply just added to the undo history)?
Maybe this is the kind of thing schwa was talking about? But still, IDK why any track height changes would create an undo point based on my preferences.
Also, I just checked which version I am running.
v6.54+dev0421a/OSX64 rev bc169c
I know it's a bit old, but so am I. And that has resulted in becoming a strong believer in avoiding upgrading anything until/unless I
absolutely need to because something is failing catastrophically.