-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added common example for key remapping for £ #3250
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Travis tests have failedHey @ycmjason, Node.js: 8if [[ $(git diff-index HEAD -- *.js *.ts *.md) ]]; then git diff; echo "Prettier Failed. Run `gulp forceprettier` and commit changes to resolve."; exit 1; fi
"vim.normalModeKeyBindings": [
{
diff --git a/src/mode/modeHandler.ts b/src/mode/modeHandler.ts
index b57ad54..c4727b6 100644
--- a/src/mode/modeHandler.ts
+++ b/src/mode/modeHandler.ts
@@ -72,59 +72,60 @@ export class ModeHandler implements vscode.Disposable {
];
this.vimState = new VimState(vscode.window.activeTextEditor!, configuration.enableNeovim);
- this.setCurrentMode(configuration.startInInsertMode ? ModeName.Insert : ModeName.Normal).then(() => {
- // Sometimes, Visual Studio Code will start the cursor in a position which
- // is not (0, 0) - e.g., if you previously edited the file and left the
- // cursor somewhere else when you closed it. This will set our cursor's
- // position to the position that VSC set it to.
-
- // This also makes things like gd work.
- // For whatever reason, the editor positions aren't updated until after the
- // stack clears, which is why this setTimeout is necessary
- this.syncCursors();
-
- // Handle scenarios where mouse used to change current position.
- const onChangeTextEditorSelection = vscode.window.onDidChangeTextEditorSelection(
- (e: vscode.TextEditorSelectionChangeEvent) => {
- if (configuration.disableExt) {
- return;
- }
-
- if (Globals.isTesting) {
- return;
- }
+ this.setCurrentMode(configuration.startInInsertMode ? ModeName.Insert : ModeName.Normal)
+ .then(() => {
+ // Sometimes, Visual Studio Code will start the cursor in a position which
+ // is not (0, 0) - e.g., if you previously edited the file and left the
+ // cursor somewhere else when you closed it. This will set our cursor's
+ // position to the position that VSC set it to.
+
+ // This also makes things like gd work.
+ // For whatever reason, the editor positions aren't updated until after the
+ // stack clears, which is why this setTimeout is necessary
+ this.syncCursors();
+
+ // Handle scenarios where mouse used to change current position.
+ const onChangeTextEditorSelection = vscode.window.onDidChangeTextEditorSelection(
+ (e: vscode.TextEditorSelectionChangeEvent) => {
+ if (configuration.disableExt) {
+ return;
+ }
- if (e.textEditor !== this.vimState.editor) {
- return;
- }
+ if (Globals.isTesting) {
+ return;
+ }
- if (this.vimState.focusChanged) {
- this.vimState.focusChanged = false;
- return;
- }
+ if (e.textEditor !== this.vimState.editor) {
+ return;
+ }
- if (this.currentMode.name === ModeName.EasyMotionMode) {
- return;
- }
+ if (this.vimState.focusChanged) {
+ this.vimState.focusChanged = false;
+ return;
+ }
- taskQueue.enqueueTask(
- () => this.handleSelectionChange(e),
- undefined,
- /**
- * We don't want these to become backlogged! If they do, we'll update
- * the selection to an incorrect value and see a jittering cursor.
- */
- true
- );
- }
- );
+ if (this.currentMode.name === ModeName.EasyMotionMode) {
+ return;
+ }
- this._disposables.push(onChangeTextEditorSelection);
- this._disposables.push(this.vimState);
+ taskQueue.enqueueTask(
+ () => this.handleSelectionChange(e),
+ undefined,
+ /**
+ * We don't want these to become backlogged! If they do, we'll update
+ * the selection to an incorrect value and see a jittering cursor.
+ */
+ true
+ );
+ }
+ );
- cb();
- }).catch(cb);
+ this._disposables.push(onChangeTextEditorSelection);
+ this._disposables.push(this.vimState);
+ cb();
+ })
+ .catch(cb);
}
/**
@@ -826,7 +827,7 @@ export class ModeHandler implements vscode.Disposable {
if (
recordedState.operators.length > 1 &&
recordedState.operators.reverse()[0].constructor ===
- recordedState.operators.reverse()[1].constructor
+ recordedState.operators.reverse()[1].constructor
) {
resultVimState = await recordedState.operator.runRepeat(
resultVimState,
@@ -1414,8 +1415,8 @@ export class ModeHandler implements vscode.Disposable {
const easyMotionHighlightRanges =
this.currentMode.name === ModeName.EasyMotionInputMode
? vimState.easyMotion.searchAction
- .getMatches(vimState.cursorPosition, vimState)
- .map(x => x.toRange())
+ .getMatches(vimState.cursorPosition, vimState)
+ .map(x => x.toRange())
: [];
this.vimState.editor.setDecorations(Decoration.EasyMotion, easyMotionHighlightRanges);
diff --git a/src/mode/modeHandlerMap.ts b/src/mode/modeHandlerMap.ts
index f45adcf..5ab2e50 100644
--- a/src/mode/modeHandlerMap.ts
+++ b/src/mode/modeHandlerMap.ts
@@ -9,7 +9,7 @@ class ModeHandlerMapImpl {
if (!modeHandler) {
isNew = true;
await new Promise((res, rej) => {
- modeHandler = new ModeHandler((err) => {
+ modeHandler = new ModeHandler(err => {
if (err) {
rej(err);
return;
diff --git a/src/mode/modes.ts b/src/mode/modes.ts
index 3670c80..4bbc29a 100644
--- a/src/mode/modes.ts
+++ b/src/mode/modes.ts
@@ -66,7 +66,9 @@ export class SearchInProgressMode extends Mode {
getStatusBarText(vimState: VimState): string {
if (vimState.globalState.searchState === undefined) {
- logger.error(`SearchInProgressMode.getStatusBarText: vimState.globalState.searchState is undefined.`);
+ logger.error(
+ `SearchInProgressMode.getStatusBarText: vimState.globalState.searchState is undefined.`
+ );
return '';
}
const leadingChar =
Prettier Failed. Run [10:21:59] Using gulpfile ~/build/VSCodeVim/Vim/gulpfile.js
[10:21:59] Starting 'forceprettier'...
[10:22:11] Finished 'forceprettier' after 12 s and commit changes to resolve. TravisBuddy Request Identifier: 20841290-fad3-11e8-857e-fba1c219b0f6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Since UK keyboard has
shift+3
to be£
instead of#
. The command for going to the previous word under cursor wouldn't work. I have been searching online and couldn't find any documentation about this. So I thought would be nice to include at README here.