Skip to content

Commit

Permalink
use inDebugRepl instead of maintaining our own key
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Sep 7, 2016
1 parent 5f01c97 commit caf964f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 36 deletions.
25 changes: 10 additions & 15 deletions extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,21 +266,16 @@ async function handleActiveEditorChange(): Promise<void> {
}

if (vscode.window.activeTextEditor !== undefined) {
if (vscode.window.activeTextEditor.document && vscode.window.activeTextEditor.document.uri.toString() === "debug:input") {
vscode.commands.executeCommand('setContext', 'vim.debugInput', true);
} else {
vscode.commands.executeCommand("setContext", "vim.debugInput", false);
taskQueue.enqueueTask({
promise: async () => {
if (vscode.window.activeTextEditor !== undefined) {
const mh = await getAndUpdateModeHandler();

mh.updateView(mh.vimState, false);
}
},
isRunning: false
});
}
taskQueue.enqueueTask({
promise: async () => {
if (vscode.window.activeTextEditor !== undefined) {
const mh = await getAndUpdateModeHandler();

mh.updateView(mh.vimState, false);
}
},
isRunning: false
});
}
}

Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,107 +45,107 @@
{
"key": "Escape",
"command": "extension.vim_escape",
"when": "editorTextFocus && !vim.debugInput"
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "Backspace",
"command": "extension.vim_backspace",
"when": "editorTextFocus && !vim.debugInput"
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "Delete",
"command": "extension.vim_delete",
"when": "editorTextFocus && vim.mode == 'Normal Mode' && !vim.debugInput"
"when": "editorTextFocus && vim.mode == 'Normal Mode' && !inDebugRepl"
},
{
"key": "tab",
"command": "extension.vim_tab",
"when": "editorFocus && vim.mode == 'Normal Mode' && !vim.debugInput"
"when": "editorFocus && vim.mode == 'Normal Mode' && !inDebugRepl"
},
{
"key": "ctrl+r",
"command": "extension.vim_ctrl+r",
"when": "editorTextFocus && !vim.debugInput"
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+f",
"command": "extension.vim_ctrl+f",
"when": "editorTextFocus && vim.useCtrlKeys && !vim.debugInput"
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+b",
"command": "extension.vim_ctrl+b",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !vim.debugInput"
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
},
{
"key": "ctrl+e",
"command": "extension.vim_ctrl+e",
"when": "editorTextFocus && vim.useCtrlKeys && !vim.debugInput"
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+y",
"command": "extension.vim_ctrl+y",
"when": "editorTextFocus && vim.useCtrlKeys && !vim.debugInput"
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+u",
"command": "extension.vim_ctrl+u",
"when": "editorTextFocus && !vim.debugInput"
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+v",
"command": "extension.vim_ctrl+v",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && vim.useCtrlKeys && !vim.debugInput"
"when": "editorTextFocus && vim.mode != 'Insert Mode' && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+d",
"command": "extension.vim_ctrl+d",
"when": "editorTextFocus && !vim.debugInput"
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+[",
"command": "extension.vim_ctrl+[",
"when": "editorTextFocus && vim.useCtrlKeys && !vim.debugInput"
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+w",
"command": "extension.vim_ctrl+w",
"when": "editorTextFocus && !vim.debugInput"
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+c",
"command": "extension.vim_ctrl+c",
"when": "editorTextFocus && vim.useCtrlKeys && !vim.debugInput"
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+a",
"command": "extension.vim_ctrl+a",
"when": "editorTextFocus && vim.useCtrlKeys && !vim.debugInput"
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+x",
"command": "extension.vim_ctrl+x",
"when": "editorTextFocus && vim.useCtrlKeys && !vim.debugInput"
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "left",
"command": "extension.vim_left",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !vim.debugInput"
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
},
{
"key": "right",
"command": "extension.vim_right",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !vim.debugInput"
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
},
{
"key": "up",
"command": "extension.vim_up",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !vim.debugInput"
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
},
{
"key": "down",
"command": "extension.vim_down",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !vim.debugInput"
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
}
],
"configuration": {
Expand Down

0 comments on commit caf964f

Please sign in to comment.