Notepad2e icon indicating copy to clipboard operation
Notepad2e copied to clipboard

Copy/Cut to clipboard commands to work on empty selection (next word)

Open ProgerXP opened this issue 4 years ago • 6 comments
trafficstars

If there is no selection, cut or copy the nearest word ("nearest" as understood by #319, #321). Don't change selection after this.

This also affects the toolbar but in Notepad2 Copy toolbar button works like Copy All if there's no selection. Do what is simpler in the code: either keep old behaviour for both (Cut button is disabled on empty selection, Copy works like Copy All) or change both (Cut and Copy work on next word if there's no selection).

ProgerXP avatar Apr 20 '21 18:04 ProgerXP

Fixed. Cut and Copy work on next word if there's no selection.

cshnik avatar Aug 09 '22 18:08 cshnik

Works but need to improve Cut with no selection: if old caret position was greater than the end of the cut word, place the caret on the start of the cut word after the operation.

some|word other
after Cut:
| other
not:
other|

same, if:
some other |
after Cut (_ = space):
some |_
not:
some ...next line... |

however, if:
| some other
after Cut is still:
|  other

Do what is simpler in the code: either keep old behaviour for both (Cut button is disabled on empty selection, Copy works like Copy All) or change both (Cut and Copy work on next word if there's no selection).

It looks like "change both" was implemented?

ProgerXP avatar Aug 10 '22 09:08 ProgerXP

Works but need to improve Cut with no selection: if old caret position was greater than the end of the cut word, place the caret on the start of the cut word after the operation.

Fixed.

It looks like "change both" was implemented?

Correct.

cshnik avatar Aug 17 '22 19:08 cshnik

Works but need to improve Cut with no selection: if old caret position was greater than the end of the cut word, place the caret on the start of the cut word after the operation.

Not done:

however, if:
| some other
after Cut is still:
|  other
but now:
 | other

ProgerXP avatar Aug 18 '22 09:08 ProgerXP

Fixed.

cshnik avatar Aug 30 '22 14:08 cshnik

Works but need to improve Cut with no selection: if old caret position was greater than the end of the cut word, place the caret on the start of the cut word after the operation.

Let's simplify this: for Cut, always put the caret to the beginning of the word that was cut, no matter the original caret position.

|.aa. => .|.
.a|a. => .|.
.aa.| => .|.

Additionally, Copy should not cause document scrolling (similar issue was with Alt+F3: https://github.com/ProgerXP/Notepad2e/issues/321#issuecomment-954056954).

ProgerXP avatar Sep 15 '22 18:09 ProgerXP

Fixed.

cshnik avatar Oct 29 '22 17:10 cshnik

Additionally, Copy should not cause document scrolling (similar issue was with Alt+F3: #321 (comment)).

Not done.

ProgerXP avatar Oct 31 '22 10:10 ProgerXP

Done.

cshnik avatar Nov 04 '22 00:11 cshnik