             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)
     }
     
 }

    /// split editor view
    @IBAction func openSplitTextView(_ sender: AnyObject?) {
        
        // find target 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,
            let splitViewController = self.splitViewController,
            let currentEditorViewController = splitViewController.viewController(for: editorView)
            else { return }
        
        // end current editing
        NSTextInputContext.current()?.discardMarkedText()

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