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

Fixes #1256 and #394: Fixes delete key and adds functionality #1644

Merged
merged 5 commits into from
May 10, 2017

Conversation

Chillee
Copy link
Member

@Chillee Chillee commented May 4, 2017

Otherwise, this PR fixes the first part of #1256 through just adding more key capturing, and fixes the second part by setting desiredColumn in visual mode.

@@ -2154,7 +2151,7 @@ export class ShiftYankOperatorVisual extends BaseOperator {

@RegisterAction
export class DeleteOperatorXVisual extends BaseOperator {
Copy link
Member Author

@Chillee Chillee May 4, 2017

Choose a reason for hiding this comment

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

Decided not to change the name because <Del> is just a synonym in visual mode. Come to think of it, can't we combine d in visual mode with this as well?

@@ -117,7 +117,7 @@
{
"key": "Delete",
"command": "extension.vim_delete",
"when": "editorTextFocus && vim.active && vim.mode == 'Normal' && !inDebugRepl"
"when": "editorTextFocus && vim.active && !inDebugRepl"
Copy link
Member

Choose a reason for hiding this comment

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

does delete work in insert mode now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it still passes through to VSCode since none of our actions capture <Del> in InsertMode.

@Chillee Chillee changed the title Fixes #1256 and #394 Fixes #1256 and #394: Fixes delete key and adds functionality May 5, 2017
@rebornix
Copy link
Member

rebornix commented May 5, 2017

@Chillee sorry I can't simply rebase this one as it somehow leads to circular dependency.

return state;
public async execCount(position: Position, vimState: VimState): Promise<VimState> {
if (vimState.recordedState.count !== 0) {
vimState.recordedState.count = Math.floor(vimState.recordedState.count / 10);
Copy link
Member

Choose a reason for hiding this comment

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

What is going on here, not sure I follow

Copy link
Member Author

@Chillee Chillee May 6, 2017

Choose a reason for hiding this comment

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

http://vimdoc.sourceforge.net/htmldoc/change.html#

What the <Del> key does if you have a count in front of it is to remove the last number from the count. So if you typed 100<Del>x, then you would only delete 10 characters.

So I simply divide the count by 10 (which removes the last number).

Copy link
Member Author

Choose a reason for hiding this comment

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

Come to think of it though, this might not work so well if <Del> is pressed when it shouldn't be pressed (in the middle of another operator for example).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah could we leave a comment explaining what's going on here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just did 👍

@xconverge xconverge merged commit e38c4f6 into VSCodeVim:master May 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants