Skip to content

Commit 9e099a8

Browse files
authored
List find + breadcrumb fixes (microsoft#162394)
* fix list style overrides fixes microsoft#158824 * make sure breadcrumbs doesn't disappear when using tree find fixes microsoft#158767
1 parent 248e669 commit 9e099a8

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/vs/base/browser/ui/inputbox/inputBox.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface IInputValidator {
5858
}
5959

6060
export interface IMessage {
61-
readonly content: string;
61+
readonly content?: string;
6262
readonly formatContent?: boolean; // defaults to false
6363
readonly type?: MessageType;
6464
}
@@ -396,7 +396,7 @@ export class InputBox extends Widget {
396396
const styles = this.stylesForType(this.message.type);
397397
this.element.style.border = styles.border ? `1px solid ${styles.border}` : '';
398398

399-
if (this.hasFocus() || force) {
399+
if (this.message.content && (this.hasFocus() || force)) {
400400
this._showMessage();
401401
}
402402
}
@@ -477,8 +477,8 @@ export class InputBox extends Widget {
477477
};
478478

479479
const spanElement = (this.message.formatContent
480-
? renderFormattedText(this.message.content, renderOptions)
481-
: renderText(this.message.content, renderOptions));
480+
? renderFormattedText(this.message.content!, renderOptions)
481+
: renderText(this.message.content!, renderOptions));
482482
spanElement.classList.add(this.classForType(this.message.type));
483483

484484
const styles = this.stylesForType(this.message.type);

src/vs/base/browser/ui/tree/abstractTree.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,11 @@ class FindController<T, TFilterData> implements IDisposable {
996996
const noMatches = this.filter.totalCount > 0 && this.filter.matchCount === 0;
997997

998998
if (this.pattern && noMatches) {
999-
this.widget?.showMessage({ type: MessageType.WARNING, content: localize('not found', "No elements found.") });
999+
if (this.tree.options.showNotFoundMessage ?? true) {
1000+
this.widget?.showMessage({ type: MessageType.WARNING, content: localize('not found', "No elements found.") });
1001+
} else {
1002+
this.widget?.showMessage({ type: MessageType.WARNING });
1003+
}
10001004
} else {
10011005
this.widget?.clearMessage();
10021006
}
@@ -1062,6 +1066,7 @@ export interface IAbstractTreeOptionsUpdate extends ITreeRendererOptions {
10621066
readonly typeNavigationEnabled?: boolean;
10631067
readonly typeNavigationMode?: TypeNavigationMode;
10641068
readonly defaultFindMode?: TreeFindMode;
1069+
readonly showNotFoundMessage?: boolean;
10651070
readonly smoothScrolling?: boolean;
10661071
readonly horizontalScrolling?: boolean;
10671072
readonly mouseWheelScrollSensitivity?: number;

src/vs/platform/list/browser/listService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
12911291

12921292
updateStyleOverrides(overrideStyles?: IColorMapping): void {
12931293
dispose(this.styler);
1294-
this.styler = overrideStyles ? attachListStyler(this.tree, this.themeService, overrideStyles) : Disposable.None;
1294+
this.styler = attachListStyler(this.tree, this.themeService, overrideStyles);
12951295
}
12961296

12971297
dispose(): void {

src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ export class BreadcrumbsFilePicker extends BreadcrumbsPicker {
381381
identityProvider: new FileIdentityProvider(),
382382
keyboardNavigationLabelProvider: new FileNavigationLabelProvider(),
383383
accessibilityProvider: this._instantiationService.createInstance(FileAccessibilityProvider),
384+
showNotFoundMessage: false,
384385
overrideStyles: {
385386
listBackground: breadcrumbsPickerBackground
386387
},
@@ -474,6 +475,7 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
474475
collapseByDefault: true,
475476
expandOnlyOnTwistieClick: true,
476477
multipleSelectionSupport: false,
478+
showNotFoundMessage: false
477479
}
478480
);
479481
}

0 commit comments

Comments
 (0)