pulsar-edit / pulsar

A Community-led Hyper-Hackable Text Editor
https://pulsar-edit.dev
Other
3.29k stars 138 forks source link

unable to paste text that I copy/cut to the clipboard from the "Save As..." dialog box #1127

Open oniwo opened 4 hours ago

oniwo commented 4 hours ago

Thanks in advance for your bug report!

What happened?

I am working on a project with so many files. some of the files internally reference files on the filesystem using their filesystem name. Mostly, I am not sure which file is accessing a certain file. Instead of typing the name of the referenced file to locate where it is referenced, I open the file, then activate the "File, Save As..." dialog box, copy or cut the file's filename and cancel the dialog box. Then activate "Find, Find in Project" and encounter the problem - I cant paste the text into the text to search text box.

Pulsar version

1.110.2023110716

Which OS does this happen on?

🐧 Red Hat based (Fedora, Alma, RockyLinux, CentOS Stream, etc.)

OS details

Fedora 41

Which CPU architecture are you running this on?

x86_64/AMD64

What steps are needed to reproduce this?

  1. Create a new File or Open an Existing File
  2. Activate "File, Save As..." dialog box
  3. Copy/Cut the filename (If there is no filename type some text and then Copy/Cut it)
  4. Cancel the dialog box (click Cancel or tap Esc key) to go back to file editing
  5. Paste the text on the clipboard. (the editor freezes)

Additional Information:

I go around the problem by first pasting the text in another application, then cut/copy it to the clipboard from that application, then come back to pulsar and now paste without any problem. Screenshot from 2024-10-31 08-01-05 Screenshot from 2024-10-31 08-40-01

savetheclocktower commented 3 hours ago

I don't know exactly what's going on with that yet, but the good news is that I can probably streamline your workflow.

Open your init file and paste this in:

const Path = require('path');

atom.commands.add('atom-text-editor', {
  'custom:copy-active-editor-file-name-to-clipboard': () => {
    let editor = atom.workspace.getActiveTextEditor();
    let filePath = editor.getPath();
    if (!filePath) return;
    atom.clipboard.write(Path.basename(filePath));
  }
});

Then save and run the command Editor: Reload Window.

Now, whenever you're in an editor, you can open the command palette and run Custom: Copy Active Editor File Name To Clipboard to put the file’s name in your clipboard automatically.


On another note: we're up to Pulsar 1.122, so you might find it useful to update. (I doubt it would fix this bug, but we've fixed a lot of other bugs since then!)