Skip to content

Commit

Permalink
Restore #63457 without #63834 break
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Nov 27, 2018
1 parent 4dd748b commit 1c62ed7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/vs/platform/search/common/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ export interface ISearchConfigurationProperties {
useReplacePreview: boolean;
showLineNumbers: boolean;
usePCRE2: boolean;
actionsPosition: 'auto' | 'right';
}

export interface ISearchConfiguration extends IFilesConfiguration {
Expand Down
10 changes: 4 additions & 6 deletions src/vs/workbench/parts/search/browser/searchView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { TreeResourceNavigator, WorkbenchTree } from 'vs/platform/list/browser/listService';
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
import { IProgressService } from 'vs/platform/progress/common/progress';
import { IPatternInfo, ISearchComplete, ISearchConfiguration, ISearchHistoryService, ISearchHistoryValues, ISearchProgressItem, ITextQuery, VIEW_ID, SearchErrorCode } from 'vs/platform/search/common/search';
import { IPatternInfo, ISearchComplete, ISearchConfiguration, ISearchHistoryService, ISearchHistoryValues, ISearchProgressItem, ITextQuery, VIEW_ID, SearchErrorCode, ISearchConfigurationProperties } from 'vs/platform/search/common/search';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { diffInserted, diffInsertedOutline, diffRemoved, diffRemovedOutline, editorFindMatchHighlight, editorFindMatchHighlightBorder, listActiveSelectionForeground } from 'vs/platform/theme/common/colorRegistry';
Expand Down Expand Up @@ -786,11 +786,9 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
return;
}

if (this.size.width >= SearchView.WIDE_VIEW_SIZE) {
dom.addClass(this.getContainer(), SearchView.WIDE_CLASS_NAME);
} else {
dom.removeClass(this.getContainer(), SearchView.WIDE_CLASS_NAME);
}
const actionsPosition = this.configurationService.getValue<ISearchConfigurationProperties>('search').actionsPosition;
const useWideLayout = this.size.width >= SearchView.WIDE_VIEW_SIZE && actionsPosition === 'auto';
dom.toggleClass(this.getContainer(), SearchView.WIDE_CLASS_NAME, useWideLayout);

this.searchWidget.setWidth(this.size.width - 28 /* container margin */);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,16 @@ configurationRegistry.registerConfiguration({
type: 'boolean',
default: false,
description: nls.localize('search.usePCRE2', "Whether to use the PCRE2 regex engine in text search. This enables using some advanced regex features like lookbehind and backreferences. However, not all PCRE2 features are supported - only features that are also supported by JavaScript.")
},
'search.actionsPosition': {
type: 'string',
enum: ['auto', 'right'],
enumDescriptions: [
nls.localize('search.actionsPositionAuto', "Position the actionbar to the right when the search view is narrow, and immediately after the content when the search view is wide."),
nls.localize('search.actionsPositionRight', "Always position the actionbar to the right."),
],
default: 'auto',
description: nls.localize('search.actionsPosition', "Controls the positioning of the actionbar on rows in the search view.")
}
}
});
Expand Down

0 comments on commit 1c62ed7

Please sign in to comment.