STTextView
STTextView copied to clipboard
Function to get current caret position
Hi,
This commit adds a delegate function what triggers if the caret has moved.
func textView(_ textView: STTextView, didMoveCaretTo row: Int, column: Int) { }
thank you for that!
I wonder whether the STTextView.didChangeSelectionNotification is insufficient for that purpose. It's modeled after how NSTextView works. The notification is fired for every selection change, and since the caret position is a selection, it is fired on every caret position change too.
The didChangeSelectionNotification notification is fired after change, meaning the handler can obtain the new position from the STTextView.
wdyt?
given the explanation above, I'm unlikely to merge these changes