Skip to content

Commit c2b4705

Browse files
committed
Little audit of unawaited promises
1 parent e54264f commit c2b4705

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

extensionBase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ export async function activate(context: vscode.ExtensionContext, handleLocal: bo
424424
if (cmd) {
425425
await new ExCommandLine(cmd, mh.vimState.currentMode).run(mh.vimState);
426426
}
427-
void mh.updateView();
427+
mh.updateView();
428428
}
429429
});
430430

@@ -455,7 +455,7 @@ export async function activate(context: vscode.ExtensionContext, handleLocal: bo
455455
command.command.slice(1, command.command.length),
456456
mh.vimState.currentMode,
457457
).run(mh.vimState);
458-
void mh.updateView();
458+
mh.updateView();
459459
} else {
460460
await vscode.commands.executeCommand(command.command, command.args);
461461
}

src/actions/commands/commandLine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ class CommandAdvanceCurrentMatch extends CommandLineAction {
414414
? SearchDirection.Backward
415415
: undefined;
416416
if (commandLine instanceof SearchCommandLine && direction !== undefined) {
417-
void commandLine.advanceCurrentMatch(vimState, direction);
417+
commandLine.advanceCurrentMatch(vimState, direction);
418418
}
419419
}
420420
}

src/cmd_line/commandLine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ export class SearchCommandLine extends CommandLine {
525525
/**
526526
* Called when <C-g> or <C-t> is pressed during SearchInProgress mode
527527
*/
528-
public async advanceCurrentMatch(vimState: VimState, direction: SearchDirection): Promise<void> {
528+
public advanceCurrentMatch(vimState: VimState, direction: SearchDirection): void {
529529
// <C-g> always moves forward in the document, and <C-t> always moves back, regardless of search direction.
530530
// To compensate, multiply the desired direction by the searchState's direction, so that
531531
// effectiveDirection == direction * (searchState.direction)^2 == direction.

src/cmd_line/commands/leftRightCenter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class LeftCommand extends ExCommand {
2222
}
2323

2424
async execute(vimState: VimState): Promise<void> {
25-
void this.executeWithRange(vimState, new LineRange(new Address({ type: 'current_line' })));
25+
await this.executeWithRange(vimState, new LineRange(new Address({ type: 'current_line' })));
2626
}
2727

2828
override async executeWithRange(vimState: VimState, range: LineRange): Promise<void> {
@@ -61,7 +61,7 @@ export class RightCommand extends ExCommand {
6161
}
6262

6363
async execute(vimState: VimState): Promise<void> {
64-
void this.executeWithRange(vimState, new LineRange(new Address({ type: 'current_line' })));
64+
await this.executeWithRange(vimState, new LineRange(new Address({ type: 'current_line' })));
6565
}
6666

6767
override async executeWithRange(vimState: VimState, range: LineRange): Promise<void> {
@@ -105,7 +105,7 @@ export class CenterCommand extends ExCommand {
105105
}
106106

107107
async execute(vimState: VimState): Promise<void> {
108-
void this.executeWithRange(vimState, new LineRange(new Address({ type: 'current_line' })));
108+
await this.executeWithRange(vimState, new LineRange(new Address({ type: 'current_line' })));
109109
}
110110

111111
override async executeWithRange(vimState: VimState, range: LineRange): Promise<void> {

src/cmd_line/commands/shift.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class ShiftCommand extends ExCommand {
3838
}
3939

4040
public async execute(vimState: VimState): Promise<void> {
41-
void this.executeWithRange(vimState, new LineRange(new Address({ type: 'current_line' })));
41+
await this.executeWithRange(vimState, new LineRange(new Address({ type: 'current_line' })));
4242
}
4343

4444
public override async executeWithRange(vimState: VimState, range: LineRange): Promise<void> {

src/mode/modeHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ export class ModeHandler implements vscode.Disposable, IModeHandler {
414414
end: this.vimState.cursorStopPosition,
415415
};
416416
}
417-
void this.updateView({ drawSelection: toDraw, revealRange: false });
417+
this.updateView({ drawSelection: toDraw, revealRange: false });
418418
}
419419
}
420420

0 commit comments

Comments
 (0)