-
-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[undo] can't undo some threaded commands #2266
Comments
The problem is a race condition in visidata/visidata/basesheet.py Line 211 in 74c6eb2
visidata/visidata/basesheet.py Line 219 in 74c6eb2
The events happen in this order:
As a confirmation that this is what's happening, undo is fixed when I remove the A fix would be to make sure |
Use a temporary workaround for the bug in saulpw#2266, to allow undo during testing of sort-selected-asc and sort-selected-desc. Use assertions to ensure no sheet data is lost.
On looking into this deeper, I realized such a fix was not workable. There's a better way to fix this. Instead of having only 1 |
Small description
After a pasting into cells or rows using
syspaste-*
, undo does not restore the original value of the cell.Steps to reproduce with sample data and a .vd
Starting with this tsv sheet:
hit
zY
on the cell that contains"first"
, thenj
and thenzP
then hit
U
, and no undo happens. Instead there is a message:nothing to undo on current sheet
.To trigger the bug,
syspaste-cells
must be done manually. If it's done inside-p script.vdj
, thenundo-last
works as expected.Additional context
saul.pw/VisiData v3.1dev
The behavior started with a9e4e05 and its parent commit.
I've looked into the undo code a bit. The problem is that when
syspaste-*
runsaddUndo()
,vd.activeCommand
isNone
, so the function returns without adding tor.undofuncs
. I'm not sure what the fix should be.The text was updated successfully, but these errors were encountered: