@@ -18,7 +18,6 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
1818import { ContextScopedFindInput } from 'vs/platform/history/browser/contextScopedHistoryWidget' ;
1919import { widgetClose } from 'vs/platform/theme/common/iconRegistry' ;
2020import * as strings from 'vs/base/common/strings' ;
21- import { TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal' ;
2221import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
2322import { showHistoryKeybindingHint } from 'vs/platform/history/browser/historyWidgetKeybindingHint' ;
2423import { status } from 'vs/base/browser/ui/aria/aria' ;
@@ -34,9 +33,12 @@ interface IFindOptions {
3433 showCommonFindToggles ?: boolean ;
3534 checkImeCompletionState ?: boolean ;
3635 showResultCount ?: boolean ;
37- appendCaseSensitiveLabel ?: string ;
38- appendRegexLabel ?: string ;
39- appendWholeWordsLabel ?: string ;
36+ appendCaseSensitiveActionId ?: string ;
37+ appendRegexActionId ?: string ;
38+ appendWholeWordsActionId ?: string ;
39+ previousMatchActionId ?: string ;
40+ nextMatchActionId ?: string ;
41+ closeWidgetActionId ?: string ;
4042 matchesLimit ?: number ;
4143 type ?: 'Terminal' | 'Webview' ;
4244}
@@ -89,9 +91,9 @@ export abstract class SimpleFindWidget extends Widget {
8991 }
9092 } ,
9193 showCommonFindToggles : options . showCommonFindToggles ,
92- appendCaseSensitiveLabel : options . appendCaseSensitiveLabel && options . type === 'Terminal' ? this . _getKeybinding ( TerminalCommandId . ToggleFindCaseSensitive ) : undefined ,
93- appendRegexLabel : options . appendRegexLabel && options . type === 'Terminal' ? this . _getKeybinding ( TerminalCommandId . ToggleFindRegex ) : undefined ,
94- appendWholeWordsLabel : options . appendWholeWordsLabel && options . type === 'Terminal' ? this . _getKeybinding ( TerminalCommandId . ToggleFindWholeWord ) : undefined ,
94+ appendCaseSensitiveLabel : options . appendCaseSensitiveActionId ? this . _getKeybinding ( options . appendCaseSensitiveActionId ) : undefined ,
95+ appendRegexLabel : options . appendRegexActionId ? this . _getKeybinding ( options . appendRegexActionId ) : undefined ,
96+ appendWholeWordsLabel : options . appendWholeWordsActionId ? this . _getKeybinding ( options . appendWholeWordsActionId ) : undefined ,
9597 showHistoryHint : ( ) => showHistoryKeybindingHint ( _keybindingService ) ,
9698 inputBoxStyles : defaultInputBoxStyles ,
9799 toggleStyles : defaultToggleStyles
@@ -131,23 +133,23 @@ export abstract class SimpleFindWidget extends Widget {
131133 } ) ) ;
132134
133135 this . prevBtn = this . _register ( new SimpleButton ( {
134- label : NLS_PREVIOUS_MATCH_BTN_LABEL ,
136+ label : NLS_PREVIOUS_MATCH_BTN_LABEL + ( options . previousMatchActionId ? this . _getKeybinding ( options . previousMatchActionId ) : '' ) ,
135137 icon : findPreviousMatchIcon ,
136138 onTrigger : ( ) => {
137139 this . find ( true ) ;
138140 }
139141 } ) ) ;
140142
141143 this . nextBtn = this . _register ( new SimpleButton ( {
142- label : NLS_NEXT_MATCH_BTN_LABEL ,
144+ label : NLS_NEXT_MATCH_BTN_LABEL + ( options . nextMatchActionId ? this . _getKeybinding ( options . nextMatchActionId ) : '' ) ,
143145 icon : findNextMatchIcon ,
144146 onTrigger : ( ) => {
145147 this . find ( false ) ;
146148 }
147149 } ) ) ;
148150
149151 const closeBtn = this . _register ( new SimpleButton ( {
150- label : NLS_CLOSE_BTN_LABEL ,
152+ label : NLS_CLOSE_BTN_LABEL + ( options . closeWidgetActionId ? this . _getKeybinding ( options . closeWidgetActionId ) : '' ) ,
151153 icon : widgetClose ,
152154 onTrigger : ( ) => {
153155 this . hide ( ) ;
0 commit comments