diff --git a/app/frontend/src/components/GpuEditor.tsx b/app/frontend/src/components/GpuEditor.tsx index 5ab37d4..56ab814 100644 --- a/app/frontend/src/components/GpuEditor.tsx +++ b/app/frontend/src/components/GpuEditor.tsx @@ -508,7 +508,7 @@ const GpuEditor = forwardRef(function GpuEditor({ const minimapFetchRef = useRef<(first: number, last: number) => void>(() => {}) // Forward ref to runSearch (declared later) so edit paths above it can // re-run the active find query without reordering the file. - const runSearchRef = useRef<() => Promise>(async () => {}) + const runSearchRef = useRef<(jump?: boolean) => Promise>(async () => {}) const minimapFetchingRef = useRef(false) const fontSizeRef = useRef(fontSize) const lastGotoLineRef = useRef(undefined) @@ -1142,7 +1142,7 @@ const GpuEditor = forwardRef(function GpuEditor({ fetchVisible() draw() void updateBracketMatch() - if (findOpenRef.current) void runSearchRef.current() + if (findOpenRef.current) void runSearchRef.current(false) }, [draw, ensureCursorVisible, fetchVisible, invalidateDirtyLines, notifyCursor, notifyDirty, updateBracketMatch]) // Replace the identifier prefix immediately left of the cursor with the @@ -1242,7 +1242,7 @@ const GpuEditor = forwardRef(function GpuEditor({ // Re-run editor.search with the current query/options and pick the match // nearest the primary cursor as "current". Fire-and-forget. - const runSearch = useCallback(async () => { + const runSearch = useCallback(async (jump = true) => { const query = findQueryRef.current if (!query) { matchesRef.current = [] @@ -1270,8 +1270,12 @@ const GpuEditor = forwardRef(function GpuEditor({ currentMatchRef.current = -1 setCurrentMatch(-1) draw() - } else { + } else if (jump) { jumpToMatch(idx) + } else { + currentMatchRef.current = idx + setCurrentMatch(idx) + draw() } } catch { matchesRef.current = [] diff --git a/app/frontend/src/components/Terminal.tsx b/app/frontend/src/components/Terminal.tsx index 96070fd..17484ed 100644 --- a/app/frontend/src/components/Terminal.tsx +++ b/app/frontend/src/components/Terminal.tsx @@ -912,11 +912,7 @@ export default function Terminal({ // input. Positioned above the block list ('top') or below it (default/'bottom'). const inputRow = (
{barPath}