CodeEditApp / CodeEditSourceEditor

A code editor view written in Swift powered by tree-sitter.
https://codeeditapp.github.io/CodeEditSourceEditor/documentation/codeeditsourceeditor
MIT License
517 stars 84 forks source link

🐞 Key event should be released if text view lost focus or after relinquished first responder #57

Closed neesonqk closed 11 months ago

neesonqk commented 2 years ago

https://github.com/CodeEditApp/CodeEditTextView/blob/9b300d8a37589f4e16719f98d1bf8763940ef0b2/Sources/CodeEditTextView/STTextViewController.swift#L182

Here, this line will be always executed whenever 'Tab' key is pressed, e.g. if the focus is on a other tab or command palette, all open tabs will insert a tab space.


textView?.insertText(String(repeating: " ", count: tabWidth))
thecoolwinter commented 2 years ago

Good catch. This should be triggered in the delegate method textView(_ textView: STTextView, didChangeTextIn affectedCharRange: NSTextRange, replacementString: String).

austincondiff commented 1 year ago

Can we confirm that this issue still exists?