Skip to content

add 'deleteWordEntire' command - #109511

Merged
Alexandru Dima (alexdima) merged 5 commits into
microsoft:masterfrom
chanmaoooo:deleteWordEntire
Nov 19, 2020
Merged

add 'deleteWordEntire' command#109511
Alexandru Dima (alexdima) merged 5 commits into
microsoft:masterfrom
chanmaoooo:deleteWordEntire

Conversation

@chanmaoooo

Copy link
Copy Markdown
Contributor

This PR fixes #109510

We added a new shortcut key ‘deleteWordEntire’.
‘deleteWordLeft’ or ‘deleteWordRight’ commands already exist. However, it is rare that we want to delete letters in only one side from the cursor.
This ‘deleteWordEntire’ command can be executed by pressing ‘ctrl + Shift + U’ (on Linux). This command deletes a word the cursor is pointing to. Even if the cursor is in the middle of the word, we can delete the whole word (not only left or right side of the cursor). Furthermore, this command also deletes the following whitespace. For example,

  • aaaaa _ bbb|bb _ ccccc -> aaaaa _ ccccc ('|' means the cursor)

So this command is convenient and will definitely improve our development efficency.

@ghost

Deleted user (ghost) commented Oct 27, 2020

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@Cons-Cat

Conscat (Cons-Cat) commented Oct 28, 2020

Copy link
Copy Markdown

I have this through an extension, and find the feature to be very useful. It would make a great contribution, imo.

@rheh Ray Hammond (rheh) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need add some tests to wordOperations.test.ts to cover the new function?

Comment thread src/vs/editor/common/controller/cursorWordOperations.ts Outdated
Comment thread src/vs/editor/common/controller/cursorWordOperations.ts Outdated

@rheh Ray Hammond (rheh) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@chanmaoooo

chanmaoooo commented Nov 5, 2020

Copy link
Copy Markdown
Contributor Author

Thank you.
I am sincerely sorry, but I'm not confident in test code (wordOperations.test.ts). Do I have to change this file?
And when the branch updated, the automatic check failed. What caused this error?

@alexdima

Copy link
Copy Markdown
Member

Thank you!

@alexdima
Alexandru Dima (alexdima) merged commit 37f44b2 into microsoft:master Nov 19, 2020
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add delete inside word action

5 participants