Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Fields authored Aug 29, 2023
2 parents f71cc56 + 1fc416d commit b118ea0
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 187 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ These settings are specific to VSCodeVim.
| vim.changeWordIncludesWhitespace | Include trailing whitespace when changing word. This configures the <kbd>cw</kbd> action to act consistently as its siblings (<kbd>yw</kbd> and <kbd>dw</kbd>) instead of acting as <kbd>ce</kbd>. | Boolean | false |
| vim.cursorStylePerMode._{Mode}_ | Configure a specific cursor style for _{Mode}_. Omitted modes will use [default cursor type](https://github.com/VSCodeVim/Vim/blob/4a6fde6dbd4d1fac1f204c0dc27c32883651ef1a/src/mode/mode.ts#L34) Supported cursors: line, block, underline, line-thin, block-outline, and underline-thin. | String | None |
| vim.digraphs._{shorthand}_ | Set custom digraph shorthands that can override the default ones. Entries should map a two-character shorthand to a descriptive string and one or more UTF16 code points. Example: `"R!": ["🚀", [55357, 56960]]` | Object | `{"R!": ["🚀", [0xD83D, 0xDE80]]` |
| vim.debug.silent | Boolean indicating whether log messages will be suppressed. | Boolean | false |
| vim.debug.loggingLevelForConsole | Maximum level of messages to log to console. Logs are visible in the [developer tools](https://code.visualstudio.com/docs/extensions/developing-extensions#_developer-tools-console). Supported values: 'error', 'warn', 'info', 'verbose', 'debug'). | String | error |
| vim.debug.loggingLevelForAlert | Maximum level of messages to present as VS Code information window. Supported values: 'error', 'warn', 'info', 'verbose', 'debug'). | String | error |
| vim.disableExtension | Disable VSCodeVim extension. This setting can also be toggled using `toggleVim` command in the Command Palette | Boolean | false |
| vim.handleKeys | Delegate configured keys to be handled by VS Code instead of by the VSCodeVim extension. Any key in `keybindings` section of the [package.json](https://github.com/VSCodeVim/Vim/blob/master/package.json) that has a `vim.use<C-...>` in the `when` argument can be delegated back to VS Code by setting `"<C-...>": false`. Example: to use `ctrl+f` for find (native VS Code behavior): `"vim.handleKeys": { "<C-f>": false }`. | String | `"<C-d>": true`<br /> `"<C-s>": false`<br /> `"<C-z>": false` |
| vim.overrideCopy | Override VS Code's copy command with our own, which works correctly with VSCodeVim. If cmd-c/ctrl-c is giving you issues, set this to false and complain [here](https://github.com/Microsoft/vscode/issues/217). | Boolean | false |
Expand Down Expand Up @@ -366,9 +363,14 @@ Custom remappings are defined on a per-mode basis.

#### Debugging Remappings

1. Are your configurations correct?
1. Adjust the extension's logging level to 'debug' and open the Output window:
1. Run `Developer: Set Log Level` from the command palette.
2. Select `Vim`, then `Debug`
3. Run `Developer: Reload window`
4. In the bottom panel, open the `Output` tab and select `Vim` from the dropdown selection.
2. Are your configurations correct?

Adjust the extension's [logging level](#vscodevim-settings) to 'debug', restart VS Code. As each remapped configuration is loaded, it is outputted to console. In the Developer Tools console, do you see any errors?
As each remapped configuration is loaded, it is logged to the Vim Output panel. Do you see any errors?

```console
debug: Remapper: normalModeKeyBindingsNonRecursive. before=0. after=^.
Expand All @@ -378,9 +380,9 @@ Custom remappings are defined on a per-mode basis.

Misconfigured configurations are ignored.

2. Does the extension handle the keys you are trying to remap?
3. Does the extension handle the keys you are trying to remap?

VSCodeVim explicitly instructs VS Code which key events we care about through the [package.json](https://github.com/VSCodeVim/Vim/blob/9bab33c75d0a53873880a79c5d2de41c8be1bef9/package.json#L62). If the key you are trying to remap is a key in which vim/vscodevim generally does not handle, then it's most likely that this extension does not receive those key events from VS Code. With [logging level](#vscodevim-settings) adjusted to 'debug', as you press keys, you should see output similar to:
VSCodeVim explicitly instructs VS Code which key events we care about through the [package.json](https://github.com/VSCodeVim/Vim/blob/9bab33c75d0a53873880a79c5d2de41c8be1bef9/package.json#L62). If the key you are trying to remap is a key in which vim/vscodevim generally does not handle, then it's most likely that this extension does not receive those key events from VS Code. In the Vim Output panel, you should see:

```console
debug: ModeHandler: handling key=A.
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1163,9 +1163,9 @@
"@types/diff": "5.0.3",
"@types/diff-match-patch": "1.0.32",
"@types/glob": "8.1.0",
"@types/lodash": "4.14.196",
"@types/lodash": "4.14.197",
"@types/mocha": "10.0.1",
"@types/node": "16.18.40",
"@types/node": "16.18.46",
"@types/parsimmon": "1.10.6",
"@types/sinon": "10.0.16",
"@types/vscode": "1.74.0",
Expand All @@ -1180,15 +1180,15 @@
"gulp-tag-version": "1.3.1",
"gulp-typescript": "5.0.1",
"husky": "^8.0.3",
"lint-staged": "^13.1.2",
"lint-staged": "^14.0.0",
"minimist": "1.2.8",
"mocha": "10.2.0",
"plugin-error": "2.0.1",
"prettier": "2.8.8",
"sinon": "15.2.0",
"ts-loader": "9.4.4",
"tslint": "6.1.3",
"typescript": "5.1.6",
"typescript": "5.2.2",
"vsce": "2.15.0",
"webpack": "5.88.2",
"webpack-cli": "5.1.4",
Expand Down
2 changes: 1 addition & 1 deletion src/cmd_line/commands/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export class FileCommand extends ExCommand {
}

const doc = await vscode.workspace.openTextDocument(fileUri);
vscode.window.showTextDocument(doc);
await vscode.window.showTextDocument(doc);

const lineNumber =
args.cmd?.type === 'line_number'
Expand Down
7 changes: 6 additions & 1 deletion test/register/register.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ suite('register', () => {

test('System clipboard works with chinese characters', async () => {
const testString = '你好';
Clipboard.Copy(testString);
await Clipboard.Copy(testString);
assert.strictEqual(testString, await Clipboard.Paste());

modeHandler.vimState.editor = vscode.window.activeTextEditor!;
Expand All @@ -76,6 +76,11 @@ suite('register', () => {
// Now try the built in vscode paste
await vscode.commands.executeCommand('editor.action.clipboardPasteAction');

// TODO: Not sure why this sleep should be necessary
await new Promise((resolve) => {
setTimeout(resolve, 100);
});

assertEqualLines([testString + testString]);
});

Expand Down
Loading

0 comments on commit b118ea0

Please sign in to comment.