Undo Record Bug Fixed

It used to not let the user to start a new project
This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2021-01-06 20:17:16 +00:00
parent e5299fd76c
commit f57b61f7e6

View file

@ -754,21 +754,22 @@ def undo_record(win):
# This function will not read the files. It's not nessesary. But it will # This function will not read the files. It's not nessesary. But it will
# make a copy of the whole thing. So I guess we need to implement some kind # make a copy of the whole thing. So I guess we need to implement some kind
# of limiter. # of limiter.
try:
limit = int(win.settings["Undo_Limit"])
limit = int(win.settings["Undo_Limit"]) # Now let's advance the undo history 1 forward.
win.undo_index = min(len(win.undo_history)+1, limit)
# Now let's advance the undo history 1 forward. # Let's read our file. Which might not exist.
win.undo_index = min(len(win.undo_history)+1, limit) f = open(win.project+'/pln/story.vcss')
# Let's read our file win.undo_history.append(f.read())
f = open(win.project+'/pln/story.vcss')
win.undo_history.append(f.read()) # And now let's limit our selves
# And now let's limit our selves
win.undo_history = win.undo_history[0-limit:]
win.undo_history = win.undo_history[0-limit:]
except:
pass
# Following 2 functions are a big buggy at the moment. I will aprecieate if # Following 2 functions are a big buggy at the moment. I will aprecieate if
# someone going to look at them. Maybe it's to do with studio/studio_storyLayer.py # someone going to look at them. Maybe it's to do with studio/studio_storyLayer.py