Skip to content

Commit 3135931

Browse files
committed
Hide Suggestion Window When Escaped
1 parent e00a49d commit 3135931

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/CodeEditSourceEditor/Controller/TextViewController+Lifecycle.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,12 @@ extension TextViewController {
261261
}
262262

263263
private func handleShowCompletions(_ event: NSEvent) -> NSEvent? {
264-
if let completionDelegate = self.completionDelegate, let cursorPosition = cursorPositions.first {
264+
if let completionDelegate = self.completionDelegate,
265+
let cursorPosition = cursorPositions.first {
266+
if SuggestionController.shared.isVisible {
267+
SuggestionController.shared.close()
268+
return event
269+
}
265270
SuggestionController.shared.showCompletions(
266271
textView: self,
267272
delegate: completionDelegate,

0 commit comments

Comments
 (0)