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

feat: Delaying the revealment of concealments #332

Merged
merged 10 commits into from
Oct 13, 2024

Conversation

bdm-k
Copy link
Contributor

@bdm-k bdm-k commented Sep 27, 2024

Closes #283

Key points of the implementation

We introduced 3 new types: Replacement, ConcealSpec, and Concealment. It's a bit confusing, but Replacement is equivalent to Concealment in the previous code, while the new Concealment now refers to something different.

  • ConcealSpec: array of Replacement. Replacements in the same conceal spec are enabled or disables simultaneously. This layer is necessary due to LaTeX commands such as \frac and \set.
  • Concealment: ConcealSpec with additional context. The decorations and atomic ranges are built from a list of Concealment objects.

The conceal function collects conceal specs. Note that it does not rely on the mouse position or whether the mouse is down. The conceal specs collected are converted into Concealment objects using information such as the previous Concealment objects. At this time, the ones that should be revealed after a delay are passed to the debouncer.

bdm-k and others added 9 commits September 20, 2024 08:38
Co-authored-by: shunby <25155092+shunby@users.noreply.github.com>
Co-authored-by: shunby <25155092+shunby@users.noreply.github.com>
Co-authored-by: shunby <25155092+shunby@users.noreply.github.com>
Co-authored-by: shunby <25155092+shunby@users.noreply.github.com>
Prevents flickering of math expressions when the cursor is placed between the braces of `\frac{}{}`
@artisticat1
Copy link
Owner

Thanks for the PR! I'll take a look soon.

@artisticat1
Copy link
Owner

This works very well. Thanks!

@artisticat1 artisticat1 merged commit 5825be2 into artisticat1:main Oct 13, 2024
@Brenzle
Copy link

Brenzle commented Oct 13, 2024

This is awesome, thanks! All of you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Delaying the reveal of concealed math
4 participants