     /// toggle if text view expands tab input
     @IBAction func toggleAutoTabExpand(_ sender: AnyObject?) {
         
-        self.isAutoTabExpandEnabled = !(self.focusedTextView?.isAutomaticTabExpansionEnabled ?? false)
+        self.isAutoTabExpandEnabled = !self.isAutoTabExpandEnabled
     }
     
     

        
        // move focus to the next text view if the view to close has a focus
        if splitViewController.focusedSubviewController == currentEditorViewController {
            let childViewControllers = splitViewController.childViewControllers as! [EditorViewController]
            let deleteIndex = childViewControllers.index(of: currentEditorViewController) ?? 0
            let count = childViewControllers.count
            var index = deleteIndex + 1
            if index >= count {
                index = count - 2
            }
            let newFocusEditorViewController = childViewControllers[index]
            guard newFocusEditorViewController != currentEditorViewController else { return }
            
            self.window?.makeFirstResponder(newFocusEditorViewController.textView)
        }

            viewController.textView?.theme = theme
        }
        self.invalidateSyntaxHighlight()
    }
    
    
    /// find target EditorViewController to manage split views for action sender
    func findTargetEditorViewController(for sender: AnyObject?) -> EditorViewController? {
        
        var view: NSView? = (sender is NSMenuItem) ? (self.window?.firstResponder as? NSView) : sender as? NSView
        while view != nil {
            if view?.identifier == "EditorView" { break }
            view = view?.superview
        }
        
        guard let editorView = view else { return nil }
        
        return self.splitViewController?.viewController(for: editorView)
    }
    
}
