Would a "redo-command" be useful? #2496
Replies: 3 comments 5 replies
-
Here's a quick prototype of this feature. I was surprised how much I like it. I didn't think I'd use it, but it makes fixing expressions pleasant and intuitive. So I vote that it should be a feature. Try it out by adding this to your .visidatarc.
I called it Putting it in .visidatarc isn't a full implementation, because Line 12 in f5c07df which will become:
|
Beta Was this translation helpful? Give feedback.
-
Brilliant! I quickly tried this and it works nicely, and I understand what you mean about being surprised by how much you like. I'll have to actually use it in a real loop to see if I have any feedback. I am wondering about input history will that tie back to the input_history.jsonl file? It does not look like it, but I have not had time to really look. Not sure if that will be possible. Thank you @midichef! |
Beta Was this translation helpful? Give feedback.
-
I tried this with the It looks like input history is working. I have not tested this too closely yet. I have not had to use this much yet, but still happy with the result. |
Beta Was this translation helpful? Give feedback.
-
I sometimes find that as I’m trying to add a column, split a value, etc. I end up in the loop of 1) perform operation (e.g.
=
addcol-expr
) and 2) enter input (e.g. python expression, regex, or shell command), see that it did not work as expected, 3) hit the undo command, 4) Rerun the command, 5) use the up arrow and make edits. I repeat the loop of step 3 to 5 until I get the result I want.This involves a command that takes some input, and adds one or more columns. I do not want the failed results as unwanted columns, and I want to edit the previous input. This is why I might use a REPL elsewhere.
It is not hard to do this loop, but it would be nice if there was a
redo
command that would: 1) undo, 2) repeat the command that was undone, 3) populate the input with the previous input.I’m not sure how hard this would be, and if this is a good solution. It would be useful if there was something that makes it possible to make this loop easier and faster.
Beta Was this translation helpful? Give feedback.
All reactions