[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ranger-users] Idea on implementing undo
From: |
XeCycle |
Subject: |
[Ranger-users] Idea on implementing undo |
Date: |
Tue, 26 Apr 2011 08:16:59 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
I got this idea several weeks ago.
This idea is simple: to reimplement all commands.
Let's add a flag into the Command class: int undoable.
Let undoable & 1 be whether the command can be undone,
undoabe & 2 be whether this command will change content of
any file, undoable & 4 be whether this command will change
the directory structure.
Then give a class UndoableCommand < Command.
Require this class to implement the undo function.
So following steps is easy: simply maintain a stack of
commands executed.
How do you think?
(I don't speak English, sorry if you had trouble reading it)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ranger-users] Idea on implementing undo,
XeCycle <=