Skip to content

Commit b82d3f7

Browse files
fix: memory leak when toggling search panel (#1808)
* fix: memory leak when toggling search panel * format
1 parent d301d6b commit b82d3f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/handlers/quickTools.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,11 @@ appSettings.on("update:quicktoolsItems:after", () => {
7676
}, 100);
7777
});
7878

79+
let historyNavigationInitialized = false;
7980
// Initialize history navigation
8081
function setupHistoryNavigation() {
82+
if (historyNavigationInitialized) return;
83+
historyNavigationInitialized = true;
8184
const { $searchInput, $replaceInput } = quickTools;
8285

8386
// Search input history navigation
@@ -87,7 +90,7 @@ function setupHistoryNavigation() {
8790
e.preventDefault();
8891
const { editor, activeFile } = editorManager;
8992
editor.focus();
90-
toggleSearch();
93+
actionStack.get("search-bar")?.action();
9194
} else if (e.key === "ArrowUp") {
9295
e.preventDefault();
9396
const newValue = searchHistory.navigateSearchUp($searchInput.el.value);

0 commit comments

Comments
 (0)