@krzyzanowskim @ctietze did either of you implement custom autocomplete with NSTextView? I'm trying to not let my NSTextView lose focus, and just display an overlay for the autocompletion. To navigate between items, I intercept moveUp (and others) inside the doCommandBy delegate method. Would you know if this is a feasible approach or am I going to hit a wall soon?

@chriseidhof @ctietze sure thing. If you'd use STTextView it comes in the package 😆 but the clue is here https://github.com/krzyzanowskim/STTextView/tree/main/Sources/STTextView/Completion/Window

The NSWindow can't become a key window, then I use local monitoring to handle the in-completion-window navigation, like here https://github.com/krzyzanowskim/STTextView/blob/8af0b9cd8828c9968b892d0755e10b27c8e137c1/Sources/STTextView/Completion/Window/STCompletionViewController.swift#L82

STTextView/Sources/STTextView/Completion/Window at main · krzyzanowskim/STTextView

TextKit2 text view without NSTextView baggage. Contribute to krzyzanowskim/STTextView development by creating an account on GitHub.

GitHub
@krzyzanowskim @ctietze interesting. Do you rely on the responder chain to pass the other events on to the text view?

@chriseidhof @krzyzanowskim I nowadays rely on the responder chain *more* but avoided that in my earlier code bases in favor of establishing my own data flow routes.

But the responder chain also comes with niceties like supplementalTarget(...) and such, so I find myself using that more and more