Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
或者
pause/disable
start/enable
我不想将特定数据推送到UndoManager's stack.
UndoManager's stack
不可能简单地不将增量推送到堆栈,因为在这种情况下无法撤消先前的增量,您还需要围绕跳过的增量转换增量。假设您有一个文档"xyz"应用于{insert, 2, "a"}获取"xyaz"然后{insert, 1, "b"}获取"xbyaz"。现在撤消第一个编辑,但保留您需要应用的第二个编辑{delete, 2+1, "a"}。这样做的算法不是很复杂,但它需要处理很多分支,所以会很麻烦。Ace 没有为此 atm 提供 api。
"xyz"
{insert, 2, "a"}
"xyaz"
{insert, 1, "b"}
"xbyaz"
{delete, 2+1, "a"}