Added usage of trigger in undo tool, in which the check of canUndo is
performed, such that it is ensured to a single command created within
the pending command factory.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>