-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow customisation of underlying NS/UI TextView #56
base: main
Are you sure you want to change the base?
allow customisation of underlying NS/UI TextView #56
Conversation
Thanks, that is an interesting extension and I'd be happy to include it. I would suggest one change. Currently, the file What are the specific problems with building main for you? (A while a go, there was a missing dependency, maybe you tried to build then. In case that was the problem, it should be fixed now.) |
Thank you @ConfusedVorlon |
I would love this feature too. |
I'd also love a way to access the underlying TextView. My use case would be to support a custom keyboard accessory view |
I assume that merely accessing the text view is not sufficient for that, but that you also need to hook into the layout of the various views making up the code view. There are four: (1) the text view, (2) the gutter view, (3) the minimap (itself a text view with custom rendering), and (4) a divider line on the left-hand side of the minimap. Views (2) - (3) are subviews of the text view and I use a custom tiling procedure to position and size them. (See the I assume that you want to put a custom view at the lower end of the text view (above the system keyboard), which means that all the other views need to get shorter. Anyway, I'm keen to hear your thoughts on this. |
Hi @mchakravarty, thanks for the reply!
Correct, I took a similar approach to the original post and exposed the text view to attach some custom keys to enable tab, shift+tab, move lines, and undo features using the |
Ok, good to know that this is sufficient here. I am still wondering whether we shouldn't have a bit more general customisation if we add such a feature. With the suggestion in the original post, you only get to manipulate the text view on set up of the code view. (I.e., what corresponds to the What do you think, does that sound reasonable? |
I'm some way past using this - so take with a pinch of salt. broadly though - if you can offer more customisation with a reasonable API - that seems like a good thing to me. |
This adds an optional param to the initialiser so that you can customise the underlying TextView.
In my case, I wanted to make it non-editable (It's just for previewing code)
I forked from the current release as main doesn't build for me - but if you're open to this then I can redo against the head.