File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Example/CodeEditSourceEditorExample/CodeEditSourceEditorExample/Views
Sources/CodeEditSourceEditor/SourceEditor Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,12 @@ struct StatusBar: View {
109109 Divider ( )
110110 . frame ( height: 12 )
111111
112+ Text ( state. findText ?? " " )
113+ . frame ( maxWidth: 30 )
114+ . lineLimit ( 1 )
115+ . truncationMode ( . head)
116+ . foregroundStyle ( . secondary)
117+
112118 Button {
113119 state. findPanelVisible. toggle ( )
114120 } label: {
Original file line number Diff line number Diff line change @@ -118,11 +118,6 @@ public struct SourceEditor: NSViewControllerRepresentable {
118118
119119 public func updateNSViewController( _ controller: TextViewController , context: Context ) {
120120 context. coordinator. updateHighlightProviders ( highlightProviders)
121- print (
122- context. coordinator. isUpdateFromTextView,
123- state. findPanelVisible,
124- controller. findViewController? . viewModel. isShowingFindPanel ?? false
125- )
126121
127122 // Prevent infinite loop of update notifications
128123 if context. coordinator. isUpdateFromTextView {
@@ -137,7 +132,7 @@ public struct SourceEditor: NSViewControllerRepresentable {
137132 controller. gutterView. needsDisplay = true
138133 }
139134
140- if let findText = state. findText {
135+ if let findText = state. findText, findText != state . findText {
141136 controller. findViewController? . viewModel. findText = findText
142137 }
143138
You can’t perform that action at this time.
0 commit comments