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

Request to change the behavior of Ctrl+X and Ctrl+C #1657

Closed
hpwamr opened this issue Sep 19, 2019 · 22 comments
Closed

Request to change the behavior of Ctrl+X and Ctrl+C #1657

hpwamr opened this issue Sep 19, 2019 · 22 comments

Comments

@hpwamr
Copy link
Collaborator

hpwamr commented Sep 19, 2019

Hello @RaiKoHoff ,
In a list:

Del
Delete
Down
  • Select "Delete", then Ctrl+X --> blank line
  • Without moving the cursor, Ctrl+C, followed by Ctrl+V

Result: Ctrl+V does NOT paste the word "Delete" and a new line is added !

Expected: like "MS Notepad", "NP++", "SciTE", "NP2-zufuliu", "MS Word", "GitHub editor", etc...

  • Simply the Ctrl+V paste again the word "Delete" without added a new line !
@hpwamr hpwamr changed the title Request to change the behavior of Ctrl + X followed by Ctrl + C followed by Ctrl + V Request to change the behavior of Ctrl+X followed by Ctrl+C followed by Ctrl+V Sep 19, 2019
@RaiKoHoff
Copy link
Collaborator

You forgot the Visual Studio Editor behavior (which we try to take into account first) and the corresponding feature request #32 😸
So this behavior is exactly what we expect 😉

@hpwamr
Copy link
Collaborator Author

hpwamr commented Sep 20, 2019

I know that MS Visual Studio, Sublime and a few others have this strange behavior...! 😬

But, the vast majority of "Text "Editors" have another "Standard"! 😃
(Like: "MS Notepad", "Notepad++", "Notepad2", Notepad2-Mod", "Notepad2-zufuliu", "SciTE", "MS Word",MS "WordPad", "GitHub editor", etc... )

In addition, with the cursor on a line without selection, Notepad3 has 2 shortcuts to perform exactly the same job! 😕

  • "Ctrl+X" = "Ctrl+Shift+X"
  • "Ctrl+F" = "Ctrl+Shift+F"

2019-09-20_085701

Maybe a vote of the community to keep this (strange) behavior in Notepad3 or to go back to the "Text Editors Standard"? 🤔

  • To keep this "Visual Studio behavior" --> 👍
  • To return to "Text Editors Standard" --> 👎

@RaiKoHoff
Copy link
Collaborator

This is no strange behavior, this is consistent behavior:
Ctrl+C : Copy selected text or, if there is no selection, copy current line. (full-stop).
Ctrl+Shift+C: Copy selected full lines, even if the selection is missing or incomplete.
That is all to know, and VS and Notepad3 are doing exactly this.

The other editors are inconsistent:
I command to copy the current (empty) line, but the are ignoring me 👎 .

@hpwamr
Copy link
Collaborator Author

hpwamr commented Sep 20, 2019

The other editors are inconsistent: 😄

OK, I would like to have the opinion of @kofifus (because he was the requestor of this change #32). 🤔

@wsrf16
Copy link

wsrf16 commented Sep 20, 2019

ctrl + c:

  1. if there is no selection, copy current line. -----> visual studio
  2. if there is no selection, copy and selecte current line. ------> idea intellij
    I think the second one is sufficient.

@hpwamr hpwamr changed the title Request to change the behavior of Ctrl+X followed by Ctrl+C followed by Ctrl+V Request to change the behavior of Ctrl+X and Ctrl+C Sep 22, 2019
@kofifus
Copy link

kofifus commented Sep 23, 2019

I like the current behavior better .. since you did ctrl+C on an empty line it seems to me you chose to copy an empty line, so the next paste will paste an empty line.

Seems you want it so that ctrl+C on an empty line will be a no-operation, personally I find that confusing.

@leeoniya
Copy link

i'm frequently tripped up by this, too.

i would prefer if ctrl+c & ctrl-x were no-ops without a selection. or at least a setting to force this behavior.

@hpwamr
Copy link
Collaborator Author

hpwamr commented Sep 23, 2019

In addition, with the cursor on a line without selection, Notepad3 has 2 shortcuts to perform exactly the same job! 😕

  • "Ctrl+X" = "Ctrl+Shift+X"
  • "Ctrl+F" = "Ctrl+Shift+F"

Seems you want it so that ctrl+C on an empty line will be a no-operation, personally I find that confusing.

Hello @kofifus
Yes also, because it is the standard behavior of 95% of text editors, even when you write this message in Github.com... 👎
Take the time to try for example: "MS Notepad", "Notepad++", "Notepad2", Notepad2-Mod", "Notepad2-zufuliu", "SciTE", "MS Word",MS "WordPad", "GitHub editor", etc... 😉

@kofifus
Copy link

kofifus commented Sep 23, 2019

I am used to coding editors (VS19, VScode etc), I dislike MS Notepad, Notepad++, etc - that's why I'm using Notepad3!

Anyways, I don't really care that much about what happens on CTRL+C on an empty line, do you really do that often ? either way is fine by me.

However I do care about what happens if you Ctrl+C on a line with text but when there is no selection - I would really like to keep the current behavior where this copies the entire line (#32) this is a very useful feature !

@wsrf16
Copy link

wsrf16 commented Sep 23, 2019

@RaiKoHoff @hpwamr
There are a thousand Hamlets in a thousand people's eyes. What do you say?😉

@RaiKoHoff
Copy link
Collaborator

RaiKoHoff commented Sep 23, 2019

On the one hand I like to keep the "copy empty line" behavior, on the other hand I tapped also in this pitfall, using Ctrl+C instead of Crtl+V.
So I think the best solution would be to make it configurable (advanced settings), maybe 3 options:

  • Ctrl+C on empty selection does nothing (no op) - preserves clipboard content.
  • Ctrl+C on empty line (which implies an empty selection) does nothing (no op)
    (which means Ctrl+C on non empty lines copies complete line) - a compromise of the two other options
  • Ctrl+C on empty selection copies complete line (even empty line) - current behavior
    (last option would be ON by default to preserve old behavior)

How to express these options in clear short form for menu entries ?

@hpwamr
Copy link
Collaborator Author

hpwamr commented Sep 23, 2019

It seems to me that it is a good idea to give users the choice via a selection menu... 🤔

current behavior
(last option would be ON by default to preserve old behavior)

But, I insist that the "default" should be the "the standard behavior of 95% of text editors (your first option = vote: 👎). 😃

@kofifus
Copy link

kofifus commented Sep 23, 2019

Well my vote is to simply keep things as they are... using ctrl+c/x/v with no selection to copy/cut/paste lines is something I do all the time and is a really useful feature even if takes a second to get used to.. try it:)

@hpwamr
Copy link
Collaborator Author

hpwamr commented Sep 23, 2019

and is a really useful feature even if takes a second to get used to.. try it:)

It's not the problem of being able to use it ...
I know it's easy to use, but you also forget that it's also a shortcut in double with "Ctrl+ Shift+C" !!! 🤔

The real problem with this behavior is that if you by mistake press "Ctrl+C" instead of "Crtl+V" on an empty line, you have erased the contents of your clipboard !!! (Try it ... 😉).

@RaiKoHoff
Copy link
Collaborator

After thinking again (and again), I am with @kofifus .
So for all the other guys (who are typing always Ctrl+C instead of Ctrl+V 😁),
there is a hidden option (set [Settings2] NoCopyLineOnEmptySelection=1) to avoid the copy on empty selection.
One exception: (from another change request #???), if the caret is within a HyperLink, the HyperLink (only) is copied regardless of setting this option.
Feel free to test dev beta version _5.19.923.2647_BETA.

@RaiKoHoff
Copy link
Collaborator

RaiKoHoff commented Sep 23, 2019

@hpwamr : No double functionality, difference between Ctrl+Shift+C and Ctrl+C is:

  • Ctrl+ Shift+C copies whole lines, regardless of begin/end of selection not at start/end of a line
  • Ctrl+C respects the selection

@hpwamr hpwamr closed this as completed Sep 23, 2019
@leeoniya
Copy link

the real problem with this behavior is that if you by mistake press "Ctrl+C" instead of "Crtl+V" on an empty line, you have erased the contents of your clipboard !!!

yes, this is the problem.

i'm not sure this is fully fixed yet. Ctrl+X has the same issue, if i accidentally hit Ctrl-X with no selection, it will blow away the clipboard, too. i guess another option NoCutLineOnEmptySelection=1 would work. i never use line-wise copy/cut and would prefer a single option like NoLinewiseCopyCut.

@hpwamr
Copy link
Collaborator Author

hpwamr commented Sep 23, 2019

Hello @RaiKoHoff , @kofifus , @kofifus @wsrf16
Again, I wish for "All novice users, newcomer users and some users who sometimes make a mistake (nobody is perfect)", that the default value is: "[Parameters 2] NoCopyLineOnEmptySelection=1 ! 🤔

@hpwamr hpwamr reopened this Sep 23, 2019
@hpwamr
Copy link
Collaborator Author

hpwamr commented Sep 23, 2019

Hello @kofifus and @RaiKoHoff ,
In addition, I want to draw your attention to the solution you gave to #1113 (in order not to disrupt newcomers).🤔

@kofifus
Copy link

kofifus commented Sep 23, 2019

The real problem with this behavior is that if you by mistake press "Ctrl+C" instead of "Crtl+V" on an empty line, you have erased the contents of your clipboard !!!

yes that's the price for this feature, and now you have the option to cancel it if you want.

I totally get your point, it's just that I think the benefit here is much greater than the disturbance to newcomers and you don't.

The maintainer made his decision and you closed the issue, why open it again ?

A bit off topic but try a clipboard manager (ie Ditto) - it will change your life ...

(> In addition, I want to draw your attention to the solution you gave to #1113 (in order not to disrupt newcomers).
I don't see the relevance here ? )

@wsrf16
Copy link

wsrf16 commented Sep 24, 2019

So settings are silver bullet?😢

@RaiKoHoff
Copy link
Collaborator

RaiKoHoff commented Sep 24, 2019

Changing the default behavior for Shortcuts is no easy decision. So Settings "are the silver bullet" (for options, which are not switched often), if you have a split party for one hand or the other. But having an option, keeping the default behavior is a strong requirement, except you have a very good argument to not keep it.
Covering user typos (Ctrl+C instead of Ctrl+V) is a weak argument.

Ed.: by the way:
Scintilla builds in a special support of this option: MSDEVLineSelect marker - a remark, just to show the relevance of this option.

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

5 participants