-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Creating a new file with clipboard contents #1995
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
Creating a new file with clipboard contents #1995
Conversation
@Syrux64 looks great so far. Yeah go ahead and implement the keyboard shortcut for this. When the navigator is in focus and cmd V is pressed, it should create the file inside the selected folder. If a file is selected, the newly created file should be a sibling to the selected file both having the same parent folder. |
@austincondiff Sure! Thanks for the heads up. |
This looks good so far! If you want to merge this before finishing the key command that would be fine. My one suggestion is you can remove your new file method and just add a new func addFile(
fileName: String,
toFile file: CEWorkspaceFile,
useExtension: String? = nil,
contents: Data? = nil // Shouldn't break any existing calls, reduces duplicate code.
) throws -> CEWorkspaceFile { |
@thecoolwinter thanks for pointing that out 👍, I'll get that fixed and raise a PR once I've implemented the shortcut. |
Where are we on this? I'd love to get this merged soon. Really great work here! |
Sorry for the long delay. So far the menu action works fine. I tried adding shortcut key via NSItem's 'Key' attribute. But all I hear is a tick sound. Can you guys suggest any other way to accomplish this? Or we could merge this PR without a shortcut key feature. |
No worries, I had lost track of this PR. I've got a commit that fixes the issue you found with the key-commands. I'm going to try and globally fix the race error you found with renaming files, as it's an issue elsewhere. I also went ahead and changed the key command to |
@allcontributors please add @Syrux64 for code |
I've put up a pull request to add @Syrux64! 🎉 |
Adds @Syrux64 as a contributor for code. This was requested by thecoolwinter [in this comment](#1995 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Thanks y'all for letting me contribute to this project. I learnt a lot <33 |
Description
Related Issue
Screenshot
REC-2025022334437.PM.mp4
Potential Bugs to fix