     @IBAction func updateAppearanceSetting(_ sender: NSButton) {
         
         UserDefaults.standard[.documentAppearance] = AppearanceMode(rawValue: sender.tag)!
+        
+        self.updateThemeSelection()
     }
     
     

        super.viewWillAppear()
        
        self.setupFontFamilyNameAndSize()
        
        // select one of cursor type radio buttons
        switch UserDefaults.standard[.cursorType] {

        self.themeTableView?.selectRowIndexes(IndexSet(integer: row), byExtendingSelection: false)
    }
    
    
    /// update selection of theme table
    private func updateThemeSelection() {
        
        let themeName = ThemeManager.shared.userDefaultSettingName
        let row = self.themeNames.firstIndex(of: themeName) ?? 0
        
        self.themeTableView?.selectRowIndexes(IndexSet(integer: row), byExtendingSelection: false)
    }
    
}


