Old 04-12-2019, 06:17 PM   #1
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,066
Default Undo Begin and End block: no redo possible

I noticed something strange with Undo Begin and EndBlock and wonder why no one else stumbled across this.

There are several issues with these functions:

- the undo name of the script is displayed in the undo list (next to the help menu), but when opening the undo history, there is no entry.

- executing redo for an undone script does not work at all


Is this a bug or expected behavior?
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 04-13-2019, 02:58 AM   #2
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,268
Default

I'm not sure what are you doing, but it shouldn't happen.
What do you need to store in the undo block? which extraflag parameter do you pass? -1 ?
I see they still have not included the extraflags documentation. schwa explained it in a recent pre release thread
heda is offline   Reply With Quote
Old 04-13-2019, 03:23 AM   #3
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,066
Default

I'm using cfilion's script "Set item end to cursor and resize trailing MIDI notes" (ReaPack).

__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 04-14-2019, 10:38 AM   #4
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,066
Default

bumpalicious
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 06-19-2019, 06:39 PM   #5
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
Default

I've noticed this with Reaticulate as well. There are times with wrapping a bunch of mutations in an undo block has no effect. For example this stanza:

https://github.com/jtackaberry/reati...p/app.lua#L208

That bit of code does a number of deletions and insertions of MIDI events, but it seems to fly under the radar of undo history. Like your screen capture, there's no trace of it and it can't be undone.
tack is offline   Reply With Quote
Old 06-19-2019, 06:45 PM   #6
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
Default

BTW for future Googlers this is the thread heda referenced in which schwa describes the undocumented flags:

https://forum.cockos.com/showpost.ph...3&postcount=27

(I'm passing -1 in my case.)
tack is offline   Reply With Quote
Old 06-19-2019, 06:54 PM   #7
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,066
Default

Thank you Tack for confirming! I was already thinking this is system specific.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 06-21-2019, 03:09 PM   #8
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

Thanks, added that info to my ReaScript-API-docs in the Reaper-Internals-thread.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-21-2019, 04:06 PM   #9
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by _Stevie_ View Post
I noticed something strange with Undo Begin and EndBlock and wonder why no one else stumbled across this.
Others have also noticed it:

Undo_ in ReaScript issue... SOLVED

ReaScript: Undo_EndBlock with flags != -1 are not added to undo history

Can't get undo block working for reaper.MIDI_InsertNote
juliansader is offline   Reply With Quote
Old 06-21-2019, 04:16 PM   #10
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
Default

Quote:
Originally Posted by juliansader View Post
Others have also noticed it
Awesome, very helpful, thanks Julian. I wasn't searching for the right things, clearly.
tack is offline   Reply With Quote
Old 06-21-2019, 04:21 PM   #11
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,066
Default

I couldn’t find anything either, strange. And apparently this fact isn’t really widely spread!
Thanks Julian, have to put that in a sticky note!
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.