Skip to content

Commit

Permalink
[cmdlog-] save prev replay when starting new replay #2531
Browse files Browse the repository at this point in the history
  • Loading branch information
midichef authored and anjakefala committed Nov 9, 2024
1 parent 2af438e commit bee4116
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion visidata/cmdlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ def replay_sync(vd, cmdlog):
with vd.DisableAsync():
vd.sync() #2352 let cmdlog finish loading
cmdlog.cursorRowIndex = 0
# save current replay, for cmdlogs that replay other cmdlogs, such as a macro executing another macro
prev_replay = vd.currentReplay
prev_replay_row = vd.currentReplayRow
vd.currentReplay = cmdlog

with Progress(total=len(cmdlog.rows)) as prog:
Expand All @@ -356,7 +359,8 @@ def replay_sync(vd, cmdlog):
vd.activeSheet.ensureLoaded()

vd.status('replay complete')
vd.currentReplay = None
vd.currentReplay = prev_replay
vd.currentReplayRow = prev_replay_row


@VisiData.api
Expand Down

0 comments on commit bee4116

Please sign in to comment.