From 267129a2bc8e74a55cb05e099303700665edb488 Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Fri, 7 Feb 2020 14:33:46 +0100 Subject: [PATCH] Fix bug which stopped Find from working when no frames are present --- extensions/Find/src/FindExtension.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/Find/src/FindExtension.ts b/extensions/Find/src/FindExtension.ts index 8563ba1b1..29d6c094e 100644 --- a/extensions/Find/src/FindExtension.ts +++ b/extensions/Find/src/FindExtension.ts @@ -88,7 +88,7 @@ class FindWidget { const termViewers = this._getViewers(); const needleRegExp = this._needleRegExp(); - for (let i=termViewers.length-1; i> 0; i--) { + for (let i=termViewers.length-1; i>=0; i--) { if (termViewers[i].find(needleRegExp, { backwards: true, startPosition: FindStartPosition.DOCUMENT_END })) { break; } @@ -180,7 +180,7 @@ class FindWidget { } i--; - for ( ; i > 0; i--) { + for ( ; i >= 0; i--) { if (termViewers[i].find(needleRegExp, { startPosition: FindStartPosition.DOCUMENT_END, backwards: true })) { return; }