Notepad3: Request to change the behavior of Ctrl+X and Ctrl+C

Created on 19 Sep 2019  路  22Comments  路  Source: rizonesoft/Notepad3

Hello @RaiKoHoff ,
In a list:

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 !
won't change works as designed

Most helpful comment

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 ?

All 22 comments

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 馃槈

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" --> 馃憥

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 馃憥 .

The other editors are inconsistent: 馃槃

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

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.

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.

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.

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... 馃槈

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 (https://github.com/rizonesoft/Notepad3/issues/32) this is a very useful feature !

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

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 ?

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: 馃憥). 馃槂

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:)

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 ... 馃槈).

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 :grin:),
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.

@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

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.

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 ! 馃

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).馃

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 ? )

So settings are silver bullet?馃槩

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

craigo- picture craigo-  路  4Comments

bravo-hero picture bravo-hero  路  3Comments

rizonesoft picture rizonesoft  路  4Comments

zb-z picture zb-z  路  3Comments

RaffaeleBianc0 picture RaffaeleBianc0  路  3Comments