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

accidently press of ctrl+C or Option+C clears clipboard. even nothing is selected #9311

Closed
mfarooqi opened this issue Sep 26, 2014 · 17 comments

Comments

@mfarooqi
Copy link

Brackets version
I found following bug in Brackets Release 0.42 and 0.43. I don't know if it has in previous versions.

OS version
Mavericks 10.9.4

steps to trigger the problem
By following this scenario you can notice the bug...

.. type something in Brackets
.. select some text
.. copy that by pressing "Ctrl+C" or "Options+C" or "Edit -> Copy"
.. In the new lines press "Ctrl+V" or "Options+V" etc.. that copied text is pasted..
.. now Don't select anything. and just press "Ctrl/Option+C" on some empty line.
.. try to paste the previously copied text By pressing Ctrl/Option+V... you wouldn't get anything. our pasted text is empty.

what you expected to happen
. while untill we don't select anything, our previously copied text should remain on the clipboard...

What happened
I'm working on a one page application using HTML+JS on one page and CSS on another.. it's 3000 lines of code almost .. It might get longer in next few days..
If i find something within my codes and copy them to paste on other lines.. one accidental press of Option+C or Ctrl+C on next blank lines empties my clipboard

Please notice this as bug and remove this. I have used Adobe Code CC .. This kind of issue doesn't exists in Adobe Code CC.

@mfarooqi mfarooqi changed the title Empty lines with nothing selection gets copied on ctrl+C or Options+C accidently press of ctrl+C or Option+C clears clipboard. even nothing is selected Sep 26, 2014
@redmunds
Copy link
Contributor

Summary: Ctrl+C copies entire line when cursor is at beginning or end of line (but not when in middle). This should be prevented when line is empty.

@mfarooqi
Copy link
Author

@redmunds I think not in my case. It copies in either cases... either on the beginning or at the end..or even in middle .. it should be prevented until nothing is selected.. not only empty line.. while duplicate works good even if nothing is selected.

@le717
Copy link
Contributor

le717 commented Sep 26, 2014

This bug is definitely valid. I downloaded Edge Code CC and used the steps @mfarooqi gave, and indeed in Brackets (running at 24b58df on master) copying a blank line actually copies a blank line, while in Edge Code CC (which is based on Brackets 0.38), copying a blank line does nothing. I almost want to call this a CodeMirror bug.

@le717
Copy link
Contributor

le717 commented Sep 26, 2014

As I thought, it is a CodeMirror bug. I've traced it to codemirror/codemirror5@f4ae5b4, specifically the d.input.value = lastCopied.join("\n"); and d.input.value = text.join("\n"); lines (this also remedies most of my issues in #9130).

I'll file this bug in CodeMirror.

EDIT: Filed as codemirror/codemirror5#2824.

@redmunds
Copy link
Contributor

@le717 Nice detective work!

@mfarooqi
Copy link
Author

@le717 Thanks for proceeding the further

@le717
Copy link
Contributor

le717 commented Sep 26, 2014

@redmunds @mfarooqi No prob, I had a few minutes of free time, so I figured I'd track it down. :)

@peterflynn
Copy link
Member

This is currently the intended behavior. Adding 'needs review' and PM tags so we can sort this out. We could consider adding a preference for this...

@peterflynn peterflynn changed the title accidently press of ctrl+C or Option+C clears clipboard. even nothing is selected [PM] accidently press of ctrl+C or Option+C clears clipboard. even nothing is selected Oct 5, 2014
@peterflynn
Copy link
Member

Btw, the reason Edge Code doesn't behave this way is just that it's a little bit behind Brackets in terms of updates. This was added in Release 0.39, and the current Edge Code version is based on Release 0.38.

@mfarooqi
Copy link
Author

Has this issue resolved.. ? is it still copying empty lines... ??

@mfarooqi mfarooqi reopened this Oct 13, 2014
@mfarooqi
Copy link
Author

I accidently closed.. but I am reopening it..

@dangoor dangoor changed the title [PM] accidently press of ctrl+C or Option+C clears clipboard. even nothing is selected accidently press of ctrl+C or Option+C clears clipboard. even nothing is selected Oct 13, 2014
@dangoor
Copy link
Contributor

dangoor commented Oct 13, 2014

Reviewed low priority in case someone wants to add this with a pref.

@mfarooqi
Copy link
Author

But this is horrible.. yes at least put it in preferences. I just downloaded the latest version. that still have this issue. A developer is usually great in blindly typing. But This is he who creates bugs. So an unintentional press of copy without selection at least make me annoyed. I'm sorry if this is just an excuse that other applications like sublime has the same "bug" then we'll put too.. then this doesn't make any sense..
And secondly.. There are always some rules defined by operating systems developers. Why dont' windows, OSX, Linux or android has this feature of copying without selection? sublime, or other SDK are dependent of OSs. inventions are great.. but re-inventions are not.
In either case If you guys are going to put this in preferences to enable or disable this "buggy feature" or not... I might stick with older version of Adobe Code CC.. I will remain an end user.. And how much an end-user effects On actual product that is only based on he feedback. I did put that... the rest is upto you.

@peterflynn
Copy link
Member

@mfarooqi If you'd like to contribute code that fixes this, we'd be happy to review it and merge in the change. But the core team for Brackets has limited resources and we have to focus on what has the most impact. Out of 100,000+ users, only a few have reported issues with this behavior. Sublime and WebStorm, also extremely popular editors, both behave exactly the same way and as far as I can tell neither of them has any preference for turning off this behavior. We are open to adding a preference anyway, but there are lots of things we could work on and we need to prioritize what will benefit people the most.

@dangoor
Copy link
Contributor

dangoor commented Oct 13, 2014

@mfarooqi We certainly appreciate the feedback. This behavior started with this feature request in CodeMirror. If an option was added around that code change, we could expose that as a preference in Brackets.

@pjwalmsley
Copy link

👍

Never noticed this in other editors, but it really bothers me in brackets (my primary editor). Often, I go to paste something but accidentally hit ctrl-c and copy over my previous content forcing me to undo a lot, recopy, then redo a lot. I prefer to use duplicate or triple click to copy a line.

@marcelgerber
Copy link
Contributor

In the next Brackets release, there will be a pref lineWiseCopyCut, which you can disable so this doesn't happen again,
Closing.

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

No branches or pull requests

8 participants
@dangoor @redmunds @peterflynn @marcelgerber @le717 @pjwalmsley @mfarooqi and others