Get the insertion point location with onSelectionChange
This release adds a new modifier, onSelectionChange
. Now whenever the insertion point changes in HighlightedTextEditor, it will run the provided callback.
HighlightedTextEditor(text: $text, highlightRules: .markdown)
.onSelectionChange { (range: NSRange) in
print(range)
}
Thanks to @santi-g-s and @ben-ole for providing the inspiration and assistance for this feature.