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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]