-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Copying a whole blank line clears previously copied content #2824
Comments
@le717 Thanks for proceeding it further. |
You never explicitly described the behavior you expect. Should the per-line copy and cut be disabled when the cursor is on a blank line? What if it contains only whitespace? |
Its simple..until something is not selected or line is empty, copy function shouldn't be functional.. rather only paste should work.. there C and V are so close on keyboard. an unexpected COPY instead of PASTE clears the clipboard. |
@marijnh The expected behavior is the per-line copy and cut should not act on a blank line. If there is whitespace, then it should act. The code is already working that way except for the two aforementioned lines, |
by the way... brackets are puerly for coders.. and in coding by default Regards Muhammad Farooqi On Thu, Oct 2, 2014 at 11:39 PM, Triangle717 notifications@github.com
|
I'm still doubtful about whether this should be changed at all. Calling it a bug is definitely nonsense. Sublime Text behaves the same way, by design. |
are you a follower of Sublime?.. I'm sure not.. but what all other great I'm currently working on an html5 ONE page application with 4000+ line of It's not a bug.. then it's not a feature too... Regards Muhammad Farooqi |
I'm interested in what the Brackets devs consider the preferred behavior here. @peterflynn @redmunds Care to chime in? |
I'm not a Brackets dev, but I wonder when you ever actually wanted to copy a blank line. |
@marijnh I honestly don't use the "copy line cursor is in" feature -- I was only aware of it because I accidentally did it one time :) Seems useful to be able to copy entire line if cursor is at beginning of line. Seems weird (to me) to copy line when cursor is at end (or middle) of line because you have to move cursor to beginning of line when pasting a whole line, anyway. Copying an empty line seems like it would never be the intention, so I think that should not be done (i.e. don't clear clipboard). Copying an all whitespace line could be the intent and useful, so that should be allowed. cc @peterflynn @njx |
@marijnh This was behavior we originally requested, in #2382. Until now I've never heard any objections/confusion related to this. As others have noted, a number of other popular editors work the same way out of the box -- including Sublime, Visual Studio, and the WebStorm/IntelliJ family. Personally, I use this feature every day so I definitely wouldn't want to see it go away. I wonder if the simplest solution is to just add a CM option for this (which we could expose as a Brackets preference)... The suggestion to disable copying blank or all-whitespace lines is interesting, but I'm not sure it's the best solution:
I've flagged the original Brackets bug for review with the larger team, so we should be able to get back to you with a more firm opinion soon. |
Btw, to @redmunds's point about paste: that part I would call a bug. It was reported as a bug in Brackets already, since that's not how other editors with this feature work: adobe/brackets#9130 (comment). When line cut/copy/paste is available regardless of cursor position, it makes moving code around really smooth and fast. |
@peterflynn Could you define more clearly what behavior you'd want to see? When does the clipboard content count as line-based? Should this property influence anything else? |
check out this please ... adobe/brackets#9311 |
Closing this. @peterflynn If you can tell me more about the way 'pasting over' blank lines should work, please open a new issue. |
Originally reported at adobe/brackets#9311.
Steps to reproduce:
I've traced this to f4ae5b4 (#2697). It appears the
d.input.value = lastCopied.join("\n");
andd.input.value = text.join("\n");
lines are the culprits, but I am not totally sure on that. Disabling them also remedies some issues I found in adobe/brackets#9130.I am not sure what CodeMirror demo I can use to reproduce this in, but the expected behavior can be seen in Brackets 0.38, and the bug in Brackets 0.42+.
The text was updated successfully, but these errors were encountered: