                          name: "theme",
                          object: nil)
 
+        deckUndoManager = window?.undoManager
         initKeyboardShortcuts()
     }
 


            if isCmd {
                switch e.keyCode {
                case 6:
                    self.window!.performClose(nil)
                    return nil

                case 3: // cmd-f
                    self.searchField.selectText(self)
                    self.searchField.becomeFirstResponder()

    @IBAction func clickCard(sender: NSTableView) {
        guard sender.clickedRow >= 0 else { return }
        let card = currentDeck!.sortedCards[sender.clickedRow]
        
        undoCardAdd(card)
    }

    func addCardToDeck(card: Card) {
