You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "scholarsmate (via GitHub)" <gi...@apache.org> on 2023/04/20 23:11:38 UTC

[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #585: Search Scrolling Index Lag Fixed

scholarsmate commented on code in PR #585:
URL: https://github.com/apache/daffodil-vscode/pull/585#discussion_r1173165905


##########
src/svelte/src/components/dataEditor.svelte:
##########
@@ -229,32 +229,13 @@ limitations under the License.
     goTo($gotoOffset)
   }
 
-  function scrollSearchResults(isNext: boolean) {
-    if ($searchResults.length > 0) {
-      let index = $searchIndex
-      if (isNext) {
-        index = index + 1
-        if (index >= $searchResults.length) {
-          index = 0
-        }
-      } else {
-        index = index - 1
-        if (index < 0) {
-          index = $searchResults.length - 1
-        }
-      }
-      $searchIndex = index
-      $gotoOffsetInput = $searchResults[index].toString($addressValue)
-      goTo($gotoOffset)
-    }
-  }
-
-  function scrollSearchNext() {
-    scrollSearchResults(true)
-  }
+  function updateSearchResults(offset?: number) {
+    $searchIndex = !offset

Review Comment:
   Why bother making the offset optional then blindly force it?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org