Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ConfusedVorlon
Copy link

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)

    CodeEditor(text: .constant(file.objCBody),
               position: $position,
               messages: $messages,
               language: .swift,
               layout: .standard) {
        textView in
        textView.isEditable = false
    }

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.

@mchakravarty
Copy link
Owner

Thanks, that is an interesting extension and I'd be happy to include it. I would suggest one change. Currently, the file OSDefinitions.swift includes aliases for types where AppKit and UIKit use different names. Hence, CETextView should go there and be named OSTextView to be in line with the other names.

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.)

@lgreydev
Copy link

Thank you @ConfusedVorlon

@srazzell
Copy link

I would love this feature too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants