Skip to content

Commit ceac385

Browse files
committed
Selecting the first item automatically in the OverlayView
1 parent 7b0ab4a commit ceac385

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

CodeEdit/Features/CodeEditUI/Views/OverlayView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ struct OverlayView<RowView: View, PreviewView: View, Option: Identifiable & Hash
7575
NSSound.beep()
7676
}
7777
}
78-
.onChange(of: options) { newValue in
79-
if newValue.isEmpty {
78+
.task(id: options) {
79+
if options.isEmpty {
8080
selection = nil
8181
} else {
8282
if !options.isEmpty {

CodeEdit/Features/Commands/Views/CommandPaletteView.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,7 @@ struct SearchResultLabel: NSViewRepresentable {
105105
}
106106

107107
func updateNSView(_ nsView: NSViewType, context: Context) {
108-
if textToMatch == "" {
109-
nsView.textColor = .labelColor
110-
} else {
111-
nsView.textColor = .secondaryLabelColor
112-
}
108+
nsView.textColor = textToMatch.isEmpty ? .labelColor : .secondaryLabelColor
113109
nsView.attributedStringValue = highlight()
114110
}
115111

0 commit comments

Comments
 (0)