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

fix: <C-d> remapping disabled by default. functionality controlled by "handleKeys" #2269

Merged
merged 4 commits into from Jan 13, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,21 @@ export class ModeHandler implements vscode.Disposable {
}
}
}
if (key === '<C-d>' && !Configuration.useCtrlKeys) {
key = '<D-d>';

// #2162 fixed by 5cc821e except <C-d> key due to this remapping
Copy link
Member

Choose a reason for hiding this comment

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

remove the comment. that information is in git blame

// Now keep the remapping but check if <C-d> is explicitly defined
// within the handleKeys scope firstly
if (key === '<C-d>') {
const useKeyCtrlD = Configuration.handleKeys['<C-d>'];
Copy link
Member

Choose a reason for hiding this comment

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

This can be all simplified to one statement.

if (Configuration.handleKeys['<C-d>'] ===false  || !Configuration.useCtrlKeys) {
...
}

Copy link
Author

@ghost ghost Jan 11, 2018

Choose a reason for hiding this comment

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

remap <C-d> to <D-d> within this statement?
what about

"vim.useCtrlKeys": false,
"vim.handleKeys": {
    "<C-d>": true
}

, should vim <C-d> enable?

if (useKeyCtrlD !== undefined) {
if (!useKeyCtrlD) {
key = '<D-d>';
}
} else if (!Configuration.useCtrlKeys) {
key = '<D-d>';
}
}

this.vimState.cursorPositionJustBeforeAnythingHappened = this.vimState.allCursors.map(
x => x.stop
);
Expand Down