Skip to content

Commit

Permalink
Fix #50893 - escape regex chars when copy search string from editor
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Jun 2, 2018
1 parent 691fbd5 commit 4734e1c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vs/workbench/parts/search/browser/searchView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,12 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
let updatedText = false;
const seedSearchStringFromSelection = this.configurationService.getValue<IEditorOptions>('editor').find.seedSearchStringFromSelection;
if (seedSearchStringFromSelection) {
const selectedText = this.getSearchTextFromEditor();
let selectedText = this.getSearchTextFromEditor();
if (selectedText) {
if (this.searchWidget.searchInput.getRegex()) {
selectedText = strings.escapeRegExpCharacters(selectedText);
}

this.searchWidget.searchInput.setValue(selectedText);
updatedText = true;
}
Expand Down

0 comments on commit 4734e1c

Please sign in to comment.