🐞 Text binding does not update view
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by tracing the SourceEditor binding used in the reproduction and follow how external changes to sourceCode reach the editor view. Reproduce the issue with the provided example, then verify that changing the bound string updates the displayed text without disrupting editor input.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Swift
- Stars
- 720
- Forks
- 162
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CodeEditApp/CodeEditSourceEditor
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
CodeEditApp/CodeEditSourceEditor#377 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
CodeEditApp/CodeEditSourceEditor#376 · 1 comment ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
CodeEditApp/CodeEditSourceEditor#378 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
All issues in CodeEditApp/CodeEditSourceEditor
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·