Skip to content

Commit

Permalink
fix notebook search focus shifting and fix bad column number (microso…
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamah authored May 16, 2023
1 parent 5a94129 commit aa0915f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/search/browser/searchResultsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,10 @@ export class SearchAccessibilityProvider implements IListAccessibilityProvider<R
const range = match.range();
const matchText = match.text().substr(0, range.endColumn + 150);
if (replace) {
return nls.localize('replacePreviewResultAria', "'{0}' at column {1} replace {2} with {3}", matchText, range.startColumn + 1, matchString, match.replaceString);
return nls.localize('replacePreviewResultAria', "'{0}' at column {1} replace {2} with {3}", matchText, range.startColumn, matchString, match.replaceString);
}

return nls.localize('searchResultAria', "'{0}' at column {1} found {2}", matchText, range.startColumn + 1, matchString);
return nls.localize('searchResultAria', "'{0}' at column {1} found {2}", matchText, range.startColumn, matchString);
}
return null;
}
Expand Down
3 changes: 2 additions & 1 deletion src/vs/workbench/contrib/search/browser/searchView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,7 @@ export class SearchView extends ViewPane {
if (editorWidget) {
// Ensure that the editor widget is binded. If if is, then this should return immediately.
// Otherwise, it will bind the widget.
await elemParent.bindNotebookEditorWidget(editorWidget);
elemParent.bindNotebookEditorWidget(editorWidget);
await elemParent.updateMatchesForEditorWidget();

const matchIndex = oldParentMatches.findIndex(e => e.id() === element.id());
Expand All @@ -1887,6 +1887,7 @@ export class SearchView extends ViewPane {

if (!this.tree.getFocus().includes(match) || !this.tree.getSelection().includes(match)) {
this.tree.setSelection([match], getSelectionKeyboardEvent());
this.tree.setFocus([match]);
}
}

Expand Down

0 comments on commit aa0915f

Please sign in to comment.