Skip to content

Commit 634d221

Browse files
committed
remove explicit uses of any
1 parent 60a424d commit 634d221

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

src/types.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,19 @@ export type vimState = {
2222
searchState_?: SearchStateInterface,
2323
lastEditActionCommand: actionCommand|void,
2424
lastPastedText?: string,
25-
lastMotion: any,
25+
lastMotion?: MotionFn|null,
2626
options: {[optionName: string]: vimOption},
2727
lastEditInputState: InputStateInterface|void,
2828
inputState: InputStateInterface,
2929
visualLine: boolean,
30-
insertModeRepeat: any,
30+
insertModeRepeat?: number,
3131
lastHSPos: number,
3232
lastHPos: number,
3333
wasInVisualBlock?: boolean,
34-
insert?: any,
3534
insertEnd?: Marker,
3635
status: string,
3736
exMode?: boolean,
38-
mode?: any,
37+
mode?: string,
3938
expectLiteralNext?: boolean,
4039
}
4140
export type Marker = ReturnType<CodeMirror["setBookmark"]>
@@ -276,7 +275,7 @@ export type operatorMotionCommand = allCommands & {
276275
}
277276
export type idleCommand = allCommands & { type: 'idle' }
278277
export type exCommand = allCommands & { type: 'ex' }
279-
export type keyToExCommand = allCommands & { type: 'keyToEx', exArgs: { [arg: string]: any } }
278+
export type keyToExCommand = allCommands & { type: 'keyToEx', exArgs: ExParams }
280279
export type keyToKeyCommand = allCommands & { toKeys: string, type: 'keyToKey' }
281280

282281
export type vimKey =
@@ -294,18 +293,18 @@ export type vimKeyMap = vimKey[];
294293

295294
export interface InputStateInterface {
296295
prefixRepeat: string[];
297-
motionRepeat: any[];
298-
operator: any| undefined | null;
296+
motionRepeat: string[];
297+
operator: string| undefined | null;
299298
operatorArgs: OperatorArgs | undefined | null;
300299
motion: string | undefined | null;
301300
motionArgs: MotionArgs | null;
302-
keyBuffer: any[];
301+
keyBuffer: string[];
303302
registerName?: string;
304303
changeQueue: null | { inserted: string, removed: string[]};
305304
operatorShortcut?: string;
306305
selectedCharacter?: string;
307306
repeatOverride?: number;
308-
changeQueueList?: any[];
307+
changeQueueList?: (InputStateInterface["changeQueue"])[];
309308
pushRepeatDigit(n: string): void;
310309
getRepeat(): number;
311310
}
@@ -360,13 +359,13 @@ export type vimExCommands = {
360359
}
361360

362361
type vimExCommandsParams = {
363-
args?: any[],
362+
args?: string[],
364363
input?: string,
365364
line?: number,
366-
setCfg?: any,
365+
setCfg?: {scope?: string},
367366
argString?: string,
368367
lineEnd?: number,
369-
commandName?: any[],
368+
commandName?: string,
370369
callback?: () => any,
371370
selectionLine?: number,
372371
selectionLineEnd?: number

src/vim.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6587,7 +6587,7 @@ export function initVim(CM) {
65876587
vim.insertEnd = undefined;
65886588
CM.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
65896589
}
6590-
if (!isPlaying && vim.insertModeRepeat > 1) {
6590+
if (!isPlaying && vim.insertModeRepeat && vim.insertModeRepeat > 1) {
65916591
// Perform insert mode repeat for commands like 3,a and 3,o.
65926592
repeatLastEdit(cm, vim, vim.insertModeRepeat - 1,
65936593
true /** repeatForInsert */);
@@ -7050,7 +7050,7 @@ export function initVim(CM) {
70507050
}, true);
70517051
}
70527052
// some commands may bring visualMode and selection out of sync
7053-
if (isHandled && !vim.visualMode && !vim.insert && vim.visualMode != cm.somethingSelected()) {
7053+
if (isHandled && !vim.visualMode && !vim.insertMode && vim.visualMode != cm.somethingSelected()) {
70547054
handleExternalSelection(cm, vim);
70557055
}
70567056
return isHandled;

0 commit comments

Comments
 (0)