Skip to content

Commit 7ac2fb3

Browse files
committed
Fix that text editor cursor jumps to end when the chat content is updated
1 parent 7e1e791 commit 7ac2fb3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Core/Sources/SuggestionWidget/CustomTextEditor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct CustomTextEditor: NSViewRepresentable {
2222

2323
func updateNSView(_ nsView: NSScrollView, context: Context) {
2424
let textView = (context.coordinator.theTextView.documentView as! NSTextView)
25+
guard textView.string != text else { return }
2526
textView.string = text
2627
}
2728
}

0 commit comments

Comments
 (0)