From a6b988216b53f334f97263207d17b0a4f23d293e Mon Sep 17 00:00:00 2001 From: 1024jp <1024jp@wolfrosch.com> Date: Fri, 16 Aug 2024 22:09:39 +0900 Subject: [PATCH] Adjust timing to start editing item --- CotEditor/Sources/FileBrowserViewController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CotEditor/Sources/FileBrowserViewController.swift b/CotEditor/Sources/FileBrowserViewController.swift index 663a503d74..e04a671199 100644 --- a/CotEditor/Sources/FileBrowserViewController.swift +++ b/CotEditor/Sources/FileBrowserViewController.swift @@ -465,6 +465,9 @@ extension FileBrowserViewController: NSTextFieldDelegate { func control(_ control: NSControl, textShouldBeginEditing fieldEditor: NSText) -> Bool { + // start editing only when the row has already been selected + guard self.outlineView.row(for: control) == self.outlineView.selectedRow else { return false } + let row = self.outlineView.row(for: control) guard let node = self.outlineView.item(atRow: row) as? FileNode else { return false }