Skip to content

Instantly share code, notes, and snippets.

@Daniel-Wang
Created July 25, 2019 04:10
Show Gist options
  • Save Daniel-Wang/4ed705c9b1d64e260104b8296980906f to your computer and use it in GitHub Desktop.
Save Daniel-Wang/4ed705c9b1d64e260104b8296980906f to your computer and use it in GitHub Desktop.
case 'u':
{
for (int i = 0; i < n; i++) {
if (!_app.commandStack().empty() && _app.commandStack().top()->canUndo()) {
_app.commandStack().top()->undo();
_app.commandStack().pop();
}
}
if (_app.commandStack().empty()) {
_app.textView().buffer().setUnsavedChanges(false);
_app.updateViews();
_app.updateStatusView("Already at oldest change");
}
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment