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

Create a file from clipboard contents when pasting text with the FileSystem dock focused in the editor #6318

Open
Calinou opened this issue Feb 19, 2023 · 2 comments

Comments

@Calinou
Copy link
Member

Calinou commented Feb 19, 2023

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

Creating a file from clipboard contents could be more streamlined. Right now, you need to create a text file, open the script editor, paste clipboard contents then save.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

When pressing Ctrl + V with text content in the clipboard and the FileSystem dock is focused (regardless of current selection), create a file with the clipboard contents.

Additionally, once #2949 is implemented, the same functionality could be provided when image data is present in the clipboard.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Since the file name cannot be guessed from the clipboard contents alone, the user needs to be asked the destination file name. The popup's response path should be relative to the currently selected folder or file. If there are several files at different levels currently selected, the least specific path "wins" to determine the output directory.

For example, KDE's Dolphin file manager displays this popup after pressing Ctrl + V with text content in the clipboard:

image

If this enhancement will not be used often, can it be worked around with a few lines of script?

No.

Is there a reason why this should be core and not an add-on in the asset library?

While this may be implementable with an add-on, this is about improving editor usability and improving consistency with the OS file manager.

@KoBeWi
Copy link
Member

KoBeWi commented Feb 19, 2023

Seems weird to me that Ctrl+V would create a text file. I'd expect that it pastes a previously copied file (from another directory or maybe from outside the project).

If anything, I'd use Ctrl+Shift+V. GIMP uses this shortcut for creating image from data.

@Calinou
Copy link
Member Author

Calinou commented Feb 20, 2023

Seems weird to me that Ctrl+V would create a text file. I'd expect that it pastes a previously copied file (from another directory or maybe from outside the project).

The system clipboard no longer holds previous data once you replace its contents with text. (X11 does have a notion of primary/secondary clipboard, where the primary clipboard can only hold text, but this is separate.)

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

No branches or pull requests

2 participants