Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In this function, syntax highlighting for constants only works correctly at a specific scroll level. #3935

Closed
mybearworld opened this issue Mar 2, 2024 · 1 comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first upstream

Comments

@mybearworld
Copy link

mybearworld commented Mar 2, 2024

The following code:

<script setup lang="ts">












const loadingMore = ref(false);
const loadMore = async () => {
  if (loadingMore.value) {
    return;
  }
  loadingMore.value = true;
  const page =
    newPostsAmount.value < 1
      ? 1
      : Math.floor(newPostsAmount.value / POSTS_PER_REQUESTS) + 1;
  const postsToRemove =
    newPostsAmount.value <= -25
      ? 0
      : newPostsAmount.value < 0
        ? POSTS_PER_REQUESTS + (newPostsAmount.value % POSTS_PER_REQUESTS)
        : newPostsAmount.value % POSTS_PER_REQUESTS;
  const response = await getResponseFromAPIRequest(
    requestURL + `&page=${page}`,
    {
      auth: true,
      schema: postsSchema,
    },
  );
  if ("status" in response) {
    await dialogStore.alert(t("loadMoreFail", { status: response.status }));
    return;
  }
  const newPosts = response.autoget.slice(postsToRemove);
  posts.value.push(...newPosts);
  newPostsAmount.value += newPosts.length;
  loadingMore.value = false;
  stopShowingLoadMore.value = response.pages === page;
};
</script>

<template>{{}}</template>

Looks like this when not scrolled:
image
But like this when scrolled:
image

More new lines require more scrolling to get the constants to appear correctly.

I've tried removing several statements, and they all caused this not to happen, and to always highlight the constants properly (assuming the mustaches are present, #3934).

@mybearworld mybearworld changed the title In this function, syntax highlighting for constands only works correctly at a specific scroll level. In this function, syntax highlighting for constants only works correctly at a specific scroll level. Mar 2, 2024
This was referenced Mar 11, 2024
@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Mar 26, 2024
@johnsoncodehk
Copy link
Member

Thanks for such a good reproductions!

@so1ve so1ve added the upstream label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first upstream
Projects
None yet
Development

No branches or pull requests

3 participants