dynamic cancel( )

cancel last command if exists

Source

cancel() {
  if (history.isEmpty) return;
  history.removeLast();
  apply();
}