@@ -40,7 +40,7 @@ export class PromptComponent extends React.Component<Props, State> {
40
40
fontSize : services . font . size * 1.2 ,
41
41
fontFamily : services . font . family ,
42
42
suggestFontSize : services . font . size ,
43
- minimap : { enabled : false } ,
43
+ minimap : { enabled : false } ,
44
44
scrollbar : {
45
45
vertical : "hidden" ,
46
46
horizontal : "hidden" ,
@@ -49,8 +49,30 @@ export class PromptComponent extends React.Component<Props, State> {
49
49
quickSuggestions : true ,
50
50
quickSuggestionsDelay : 0 ,
51
51
parameterHints : true ,
52
+ fontLigatures : true ,
52
53
} ) ;
53
54
55
+ this . editor . addCommand (
56
+ monaco . KeyCode . UpArrow ,
57
+ ( ) => this . setPreviousHistoryItem ( ) ,
58
+ "!suggestWidgetVisible" ,
59
+ ) ;
60
+ this . editor . addCommand (
61
+ monaco . KeyMod . WinCtrl | monaco . KeyCode . KEY_P ,
62
+ ( ) => this . setPreviousHistoryItem ( ) ,
63
+ "!suggestWidgetVisible" ,
64
+ ) ;
65
+ this . editor . addCommand (
66
+ monaco . KeyCode . DownArrow ,
67
+ ( ) => this . setNextHistoryItem ( ) ,
68
+ "!suggestWidgetVisible" ,
69
+ ) ;
70
+ this . editor . addCommand (
71
+ monaco . KeyMod . WinCtrl | monaco . KeyCode . KEY_N ,
72
+ ( ) => this . setNextHistoryItem ( ) ,
73
+ "!suggestWidgetVisible" ,
74
+ ) ;
75
+
54
76
this . focus ( ) ;
55
77
}
56
78
@@ -124,11 +146,14 @@ export class PromptComponent extends React.Component<Props, State> {
124
146
}
125
147
}
126
148
127
- shouldNavigateHistory ( ) {
128
- return this . state . displayedHistoryRecordID || this . editor . getValue ( ) === "" ;
149
+ setValue ( value : string ) : void {
150
+ this . editor . setValue ( value ) ;
151
+ this . editor . setPosition ( { lineNumber : 1 , column : value . length + 1 } ) ;
152
+ this . prompt . setValue ( value ) ;
153
+ this . focus ( ) ;
129
154
}
130
155
131
- setPreviousHistoryItem ( ) : void {
156
+ private setPreviousHistoryItem ( ) : void {
132
157
const currentID = this . state . displayedHistoryRecordID ;
133
158
if ( currentID ) {
134
159
const currentRecord = services . history . get ( currentID ) ;
@@ -150,7 +175,7 @@ export class PromptComponent extends React.Component<Props, State> {
150
175
}
151
176
}
152
177
153
- setNextHistoryItem ( ) : void {
178
+ private setNextHistoryItem ( ) : void {
154
179
const currentID = this . state . displayedHistoryRecordID ;
155
180
if ( currentID ) {
156
181
const currentRecord = services . history . get ( currentID ) ;
@@ -168,13 +193,6 @@ export class PromptComponent extends React.Component<Props, State> {
168
193
}
169
194
}
170
195
171
- setValue ( value : string ) : void {
172
- this . editor . setValue ( value ) ;
173
- this . editor . setPosition ( { lineNumber : 1 , column : value . length + 1 } ) ;
174
- this . prompt . setValue ( value ) ;
175
- this . focus ( ) ;
176
- }
177
-
178
196
private get promptContentNode ( ) : HTMLDivElement {
179
197
/* tslint:disable:no-string-literal */
180
198
return this . refs [ "prompt-content" ] as HTMLDivElement ;
0 commit comments