(key: string)
| 428 | } |
| 429 | |
| 430 | private async handleKeyEventLangmapped(key: string): Promise<void> { |
| 431 | if (this.remapState.forceStopRecursiveRemapping) { |
| 432 | return; |
| 433 | } |
| 434 | |
| 435 | const now = Date.now(); |
| 436 | |
| 437 | const printableKey = Notation.printableKey(key, configuration.leader); |
| 438 | Logger.debug(`Handling key: ${printableKey}`); |
| 439 | |
| 440 | if ( |
| 441 | // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison |
| 442 | (key === SpecialKeys.TimeoutFinished || |
| 443 | this.vimState.recordedState.bufferedKeys.length > 0) && |
| 444 | this.vimState.recordedState.bufferedKeysTimeoutObj |
| 445 | ) { |
| 446 | // Handle the bufferedKeys or append the new key to the previously bufferedKeys |
| 447 | clearTimeout(this.vimState.recordedState.bufferedKeysTimeoutObj); |
| 448 | this.vimState.recordedState.bufferedKeysTimeoutObj = undefined; |
| 449 | this.vimState.recordedState.commandList = [...this.vimState.recordedState.bufferedKeys]; |
| 450 | this.vimState.recordedState.bufferedKeys = []; |
| 451 | } |
| 452 | |
| 453 | // rewrite copy |
| 454 | if (configuration.overrideCopy) { |
| 455 | // The conditions when you trigger a "copy" rather than a ctrl-c are |
| 456 | // too sophisticated to be covered by the "when" condition in package.json |
| 457 | if (key === '<D-c>') { |
| 458 | key = '<copy>'; |
| 459 | } |
| 460 | |
| 461 | if (key === '<C-c>' && process.platform !== 'darwin') { |
| 462 | if (!configuration.useCtrlKeys || isVisualMode(this.vimState.currentMode)) { |
| 463 | key = '<copy>'; |
| 464 | } |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | // <C-d> triggers "add selection to next find match" by default, |
| 469 | // unless users explicity make <C-d>: true |
| 470 | // TODO: Destroy this silliness |
| 471 | if (key === '<C-d>' && !(configuration.handleKeys['<C-d>'] === true)) { |
| 472 | key = '<D-d>'; |
| 473 | } |
| 474 | |
| 475 | this.vimState.cursorsInitialState = this.vimState.cursors; |
| 476 | this.vimState.recordedState.commandList.push(key); |
| 477 | |
| 478 | const oldMode = this.vimState.currentMode; |
| 479 | const oldFullMode = this.vimState.currentModeIncludingPseudoModes; |
| 480 | const oldStatusBarText = StatusBar.getText(); |
| 481 | const oldWaitingForAnotherActionKey = this.vimState.recordedState.waitingForAnotherActionKey; |
| 482 | |
| 483 | let handledAsRemap = false; |
| 484 | let handledAsAction = false; |
| 485 | try { |
| 486 | // Handling special case for '0'. From Vim documentation (:help :map-modes) |
| 487 | // Special case: While typing a count for a command in Normal mode, mapping zero |
no test coverage detected