@@ -8,7 +8,7 @@ import 'vs/css!./findInput';
88
99import * as nls from 'vs/nls' ;
1010import * as dom from 'vs/base/browser/dom' ;
11- import { IMessage as InputBoxMessage , IInputValidator , InputBox , IInputBoxStyles } from 'vs/base/browser/ui/inputbox/inputBox' ;
11+ import { IMessage as InputBoxMessage , IInputValidator , IInputBoxStyles , HistoryInputBox } from 'vs/base/browser/ui/inputbox/inputBox' ;
1212import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview' ;
1313import { Widget } from 'vs/base/browser/ui/widget' ;
1414import { Event , Emitter } from 'vs/base/common/event' ;
@@ -28,6 +28,7 @@ export interface IFindInputOptions extends IFindInputStyles {
2828 readonly appendCaseSensitiveLabel ?: string ;
2929 readonly appendWholeWordsLabel ?: string ;
3030 readonly appendRegexLabel ?: string ;
31+ readonly history ?: string [ ] ;
3132}
3233
3334export interface IFindInputStyles extends IInputBoxStyles {
@@ -62,7 +63,7 @@ export class FindInput extends Widget {
6263 private wholeWords : WholeWordsCheckbox ;
6364 private caseSensitive : CaseSensitiveCheckbox ;
6465 public domNode : HTMLElement ;
65- public inputBox : InputBox ;
66+ public inputBox : HistoryInputBox ;
6667
6768 private readonly _onDidOptionChange = this . _register ( new Emitter < boolean > ( ) ) ;
6869 public readonly onDidOptionChange : Event < boolean /* via keyboard */ > = this . _onDidOptionChange . event ;
@@ -108,7 +109,7 @@ export class FindInput extends Widget {
108109 this . domNode = null ;
109110 this . inputBox = null ;
110111
111- this . buildDomNode ( options . appendCaseSensitiveLabel || '' , options . appendWholeWordsLabel || '' , options . appendRegexLabel || '' ) ;
112+ this . buildDomNode ( options . appendCaseSensitiveLabel || '' , options . appendWholeWordsLabel || '' , options . appendRegexLabel || '' , options . history ) ;
112113
113114 if ( Boolean ( parent ) ) {
114115 parent . appendChild ( this . domNode ) ;
@@ -259,12 +260,12 @@ export class FindInput extends Widget {
259260 this . inputBox . width = w ;
260261 }
261262
262- private buildDomNode ( appendCaseSensitiveLabel : string , appendWholeWordsLabel : string , appendRegexLabel : string ) : void {
263+ private buildDomNode ( appendCaseSensitiveLabel : string , appendWholeWordsLabel : string , appendRegexLabel : string , history : string [ ] ) : void {
263264 this . domNode = document . createElement ( 'div' ) ;
264265 this . domNode . style . width = this . width + 'px' ;
265266 dom . addClass ( this . domNode , 'monaco-findInput' ) ;
266267
267- this . inputBox = this . _register ( new InputBox ( this . domNode , this . contextViewProvider , {
268+ this . inputBox = this . _register ( new HistoryInputBox ( this . domNode , this . contextViewProvider , {
268269 placeholder : this . placeholder || '' ,
269270 ariaLabel : this . label || '' ,
270271 validationOptions : {
@@ -278,7 +279,8 @@ export class FindInput extends Widget {
278279 inputValidationWarningBackground : this . inputValidationWarningBackground ,
279280 inputValidationWarningBorder : this . inputValidationWarningBorder ,
280281 inputValidationErrorBackground : this . inputValidationErrorBackground ,
281- inputValidationErrorBorder : this . inputValidationErrorBorder
282+ inputValidationErrorBorder : this . inputValidationErrorBorder ,
283+ history
282284 } ) ) ;
283285
284286 this . regex = this . _register ( new RegexCheckbox ( {
0 commit comments