Skip to content

cosmic changes #74

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

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

cosmic changes #74

wants to merge 17 commits into from

Conversation

robtfm
Copy link
Contributor

@robtfm robtfm commented Aug 30, 2024

not to be merged as is, but in case it's useful as a starting point for you in the future.

here i have modifications to support bevy 0.14 with bevy#10193 (cosmic text) cherry picked in.

i added floating cursor, selection management, undo/redo and cut/copy/paste (on a feature flag for clipboard integration - it might be nice to allow some other non-system-clipboard support via resources/events but i don't need it personally).

still plan to add at least some mouse support (probably optional in settings).

@robtfm
Copy link
Contributor Author

robtfm commented Aug 30, 2024

Recording.2024-08-30.142832.mp4

@rparrett
Copy link
Owner

Lovely, thank you!

I was playing around with this a bit with https://github.com/rparrett/bevy_simple_text_input/tree/bevy_main as a base earlier, but really wasn't liking how it was going. I was referencing https://github.com/tigregalis/bevy_text_editor, but your implementation retaining an Editor seems way nicer.

@robtfm
Copy link
Contributor Author

robtfm commented Aug 30, 2024

it does require copying the buffer (though using the lazy init, only when needed)... but it seems bevy does this internally for TextMeasures already, so maybe it's not so bad.

perhaps cosmic's BufferRef could be extended with a shared Arc<RwLock<Buffer>> variant as well, but i am not really willing to get into that at the moment.

@rparrett
Copy link
Owner

tigregalis had some ideas over here: pop-os/cosmic-text#285

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.

2 participants