CodeEditApp / CodeEditApp/CodeEditSourceEditor

🐞 Text binding does not update view

Offen
#372 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Swift
Sterne
719
Forks
160
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Description

I noticed that that updating a text state (String), which has a binding to the code edit view, does not update the text view.

### To Reproduce

This is how I use the view:

```
@State var sourceCode = "initial value"

var body: some View {
SourceEditor(
$sourceCode,
language: .swift,
configuration: SourceEditorConfiguration(
appearance: .init(
theme: .dark,
font: NSFont.monospacedSystemFont(ofSize: 12, weight: .medium),
wrapLines: false,
),
behavior: .init(indentOption: .spaces(count: 4)),
peripherals: .init(showMinimap: false)
),
state: $editorState,
coordinators: [],
)
}

// Somewhere, I do
sourceCode = "some new string"
```

The editor still contains "initial value", although `sourceCode` is "some new string"

### Expected Behavior

The code editor should show "some new string"

### Version Information

CodeEditSourceEditor: 0.15.2
macOS: 26.5
Xcode: 26.5.0

### Additional Context

I have a pull request ready with a fix, but I'm not sure if this is the correct way to do it, because I didn't have time to dive into the implementation of this package, yet.

### Screenshots

_No response_

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.