Skip to content

Commit

Permalink
[cmdlog-] do not add undos if there is no activeCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Nov 6, 2023
1 parent 11a4a53 commit a9e4e05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion visidata/undo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def addUndo(vd, undofunc, *args, **kwargs):
return
r = vd.modifyCommand
# some special commands, like open-file, do not have an undofuncs set
if not r or not isUndoableCommand(r.longname) or not vd.isLoggableCommand(vd.activeCommand.longname):
# do not set undofuncs for non-logged commands
if not r or not isUndoableCommand(r.longname) or not vd.activeCommand or not vd.isLoggableCommand(vd.activeCommand.longname):
return
if not r.undofuncs:
r.undofuncs = []
Expand Down

0 comments on commit a9e4e05

Please sign in to comment.