mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-20 00:54:47 +00:00
Autosave optimized
- autosave.bin doesn't need to be opened and read anymore, instead it's mere existence flags the availability of a restorable backup
This commit is contained in:
parent
d0b8ae7635
commit
0b70a26985
1 changed files with 3 additions and 7 deletions
|
@ -504,9 +504,7 @@ FUNCTION ide2 (ignore)
|
||||||
|
|
||||||
'restore autosave?
|
'restore autosave?
|
||||||
'undo/redo
|
'undo/redo
|
||||||
OPEN tmpdir$ + "autosave.bin" FOR BINARY AS #150
|
IF _FILEEXISTS(AutosaveFile$) THEN 'test for flag file
|
||||||
IF LOF(150) = 1 THEN
|
|
||||||
CLOSE #150
|
|
||||||
r$ = iderestore$
|
r$ = iderestore$
|
||||||
PCOPY 3, 0: SCREEN , , 3, 0
|
PCOPY 3, 0: SCREEN , , 3, 0
|
||||||
IF r$ = "Y" THEN
|
IF r$ = "Y" THEN
|
||||||
|
@ -531,8 +529,6 @@ FUNCTION ide2 (ignore)
|
||||||
END IF
|
END IF
|
||||||
CLOSE #150
|
CLOSE #150
|
||||||
END IF
|
END IF
|
||||||
ELSE
|
|
||||||
CLOSE #150
|
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF ideunsaved <> 1 THEN 'no file restored (takes priority over loading file from command line)
|
IF ideunsaved <> 1 THEN 'no file restored (takes priority over loading file from command line)
|
||||||
|
@ -1275,7 +1271,7 @@ FUNCTION ide2 (ignore)
|
||||||
'set undo flag once
|
'set undo flag once
|
||||||
IF ideundoflag = 0 THEN
|
IF ideundoflag = 0 THEN
|
||||||
ideundoflag = 1
|
ideundoflag = 1
|
||||||
OPEN tmpdir$ + "autosave.bin" FOR BINARY AS #150: a$ = CHR$(1): PUT #150, , a$: CLOSE #150 'set flag
|
OPEN AutosaveFile$ FOR OUTPUT AS #150: CLOSE #150 'create flag file
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
ELSE
|
ELSE
|
||||||
|
@ -6219,7 +6215,7 @@ FUNCTION ide2 (ignore)
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
END IF
|
END IF
|
||||||
fh = FREEFILE: OPEN tmpdir$ + "autosave.bin" FOR OUTPUT AS #fh: CLOSE #fh
|
IF _FILEEXISTS(AutosaveFile$) THEN KILL AutosaveFile$ 'remove flag file
|
||||||
WriteBuffers tmpdir$ + "recent.bin"
|
WriteBuffers tmpdir$ + "recent.bin"
|
||||||
WriteBuffers tmpdir$ + "searched.bin"
|
WriteBuffers tmpdir$ + "searched.bin"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
|
|
Loading…
Reference in a new issue