Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Add cut/copy/paste to the context menu #12674

Merged
merged 1 commit into from
Sep 1, 2016

Conversation

ficristo
Copy link
Collaborator

Switch cut/copy/paste to use document.execCommand and add them to the context menu.
Before, on right click the underline word were selected but it was counterintuitive for the context menu usage so I removed it.
We need adobe/brackets-shell#567 to make the paste command work.

@marcelgerber
Copy link
Contributor

First things first: We don't need the ignoreCommand handler any more :)

What's the behaviour on Linux, as execCommand("copy/cat/paste") is only supported in Chrome 42+?

@ficristo
Copy link
Collaborator Author

Oddly seemed to work for me on Ubuntu 16.04 without any other changes.
Would be nice to have some confirmations.
(I didn't try the installer and I don't know if would change anything)

@marcelgerber
Copy link
Contributor

Yeah, confirmed on Linux now. Works without any shell changes.
Works fine on Windows for me, too.

I just noticed one issue:

  1. Position your cursor on the end of a line that consists of only spaces for indentation.
  2. Right-click anywhere in that line

Result: The whitespace is selected, which makes pasting a whole lot harder, as it will delete the whitespace.

@ficristo
Copy link
Collaborator Author

The whitespace is selected

I cannot reproduce...

@marcelgerber
Copy link
Contributor

Strange. I can't reproduce any more either.

@zaggino
Copy link
Contributor

zaggino commented Aug 25, 2016

Tested. "Cut" and "Copy" work fine, "Paste" doesn't do anything for me. Windows shell.

@ficristo
Copy link
Collaborator Author

"Paste" doesn't do

Have you tested with the shell PR? Otherwise is expected.

@zaggino
Copy link
Contributor

zaggino commented Aug 26, 2016

Ah, my bad. Gonna test and merge if it works.

@ficristo
Copy link
Collaborator Author

Can you wait to merge? I need to cleanup a bit this first.

@zaggino
Copy link
Contributor

zaggino commented Aug 26, 2016

👍 ping me then

@ficristo ficristo added this to the Release 1.8 milestone Aug 26, 2016
@marcelgerber
Copy link
Contributor

@ficristo Would love to merge this after your cleanup work is done!

@ficristo
Copy link
Collaborator Author

ficristo commented Sep 1, 2016

I've removed the unused ignoreCommand.
Now it's ready for another pass.

@marcelgerber
Copy link
Contributor

All good.
Thank you!

@marcelgerber marcelgerber merged commit fd2b884 into adobe:master Sep 1, 2016
@ficristo ficristo deleted the context-menu branch September 2, 2016 18:00
@GuyRogers
Copy link

Thanks so much for the Cut/Copy/Paste. It was one of the few things that was driving me mad in Brackets 👍

humphd added a commit to humphd/brackets that referenced this pull request Feb 16, 2017
relies on document.execCommand() which doesn't work well (esp. for paste)
in browsers.  See adobe#12674.

This reverts commit d93ccc5.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants