File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed
Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 237237 "description" : " Clear selections when running command setInsertMode" ,
238238 "deprecationMessage" : " Deprecated: use modalEditor.clearSelections by yourself instead" ,
239239 "default" : true
240+ },
241+ "modalEditor.misc.parseNumberPrefix" : {
242+ "type" : " boolean" ,
243+ "description" : " Parse leading number as prefix instead of normal keys" ,
244+ "default" : true
240245 }
241246 }
242247 }
Original file line number Diff line number Diff line change @@ -156,7 +156,8 @@ export class AppState {
156156 // common keymap
157157 this . config . keybindings [ "" ] ,
158158 // whether it's command mode
159- mode === COMMAND
159+ mode === COMMAND ,
160+ this . config . misc . parseNumberPrefix
160161 ) ;
161162 }
162163
Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ export type Misc = {
6767 /// Default to use when extension starts
6868 defaultMode : string ,
6969 /// Clear selections when running command setInsertMode (deprecated)
70- clearSelectionsOnInsertMode : boolean
70+ clearSelectionsOnInsertMode : boolean ,
71+ /// Parse leading number as prefix instead of normal keys
72+ parseNumberPrefix : boolean ,
7173} ;
7274
7375/**
@@ -106,7 +108,8 @@ const defaultMisc: Misc = {
106108 presetDirectory : "~/.config/vscode-modal-editor" ,
107109 autoloadPreset : "" ,
108110 defaultMode : NORMAL ,
109- clearSelectionsOnInsertMode : true
111+ clearSelectionsOnInsertMode : true ,
112+ parseNumberPrefix : true ,
110113} ;
111114
112115export function getStyle ( mode : string , styles : Styles ) {
Original file line number Diff line number Diff line change @@ -47,14 +47,16 @@ export class KeyEventHandler {
4747 keys ! : string ;
4848 /// Count prefix
4949 count ! : string ;
50- /// Whether it is parsing the prefix count
50+ /// Whether it is parsing the number prefix
5151 parsingCount ! : boolean ;
5252
5353 constructor (
5454 public keyStatusBar : vscode . StatusBarItem ,
5555 public keymap : Keymap | undefined ,
5656 public commonKeymap : Keymap | undefined ,
57- public commandMode : boolean
57+ public commandMode : boolean ,
58+ /// Whether to parse number prefix
59+ public parseNumberPrefix : boolean ,
5860 ) {
5961 this . reset ( ) ;
6062 }
@@ -177,7 +179,7 @@ export class KeyEventHandler {
177179 this . currentKeymap = this . keymap ;
178180 this . currentCommonKeymap = this . commonKeymap ;
179181 this . count = "" ;
180- this . parsingCount = true ;
182+ this . parsingCount = this . parseNumberPrefix ;
181183 this . setKeys ( "" ) ;
182184 }
183185
You can’t perform that action at this time.
0 commit comments