From adae5adf0ca03d7a6d53dc472f403432ff0d0e88 Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Tue, 6 Aug 2024 09:47:44 -0700 Subject: [PATCH] feat: highlight text in workspace search on open and add backwards nav --- plugins/workspace-search/src/workspace_search.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/workspace-search/src/workspace_search.ts b/plugins/workspace-search/src/workspace_search.ts index 59b0277e0c..e13a95ca00 100644 --- a/plugins/workspace-search/src/workspace_search.ts +++ b/plugins/workspace-search/src/workspace_search.ts @@ -362,7 +362,11 @@ export class WorkspaceSearch implements Blockly.IPositionable { this.close(); } else if (e.key === 'Enter') { if (this.searchOnInput) { - this.next(); + if (e.shiftKey) { + this.previous(); + } else { + this.next(); + } } else { if (!this.inputElement) return; const inputValue = this.inputElement.value.trim(); @@ -440,6 +444,7 @@ export class WorkspaceSearch implements Blockly.IPositionable { open() { this.setVisible(true); this.inputElement?.focus(); + this.inputElement?.select(); if (this.searchText) { this.searchAndHighlight(this.searchText); }