Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix Errors in suggest.ts #355

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

IsuminI
Copy link

@IsuminI IsuminI commented Nov 24, 2024

Pull Request Description

This pull request fixes a bug that occurs when using ">[!" (without a space between ">" and "[") instead of "> [!".

Changes Proposed

  • In the testAndReturnQuery function, prefix and query groups were created during matching, enabling cursor movement without using an offset.
  • So, we removed the unnecessary offset variable.
  • In the AdmonitionSuggest class, when selecting a suggestion after "```ad-", modified it so that the cursor moves to the position after the text.
  • Refactored the code, because "this.context" was used a lot.

Related Issues

Fixes #339 ( Strange Behavior of Callout Type Autocompletion )

Checklist

  • I have read the contribution guidelines and code of conduct.
  • I have tested the changes locally and they are working as expected.
  • I have added appropriate comments and documentation for the code changes.
  • My code follows the coding style and standards of this project.
  • I have rebased my branch on the latest main (or master) branch.
  • All tests (if applicable) have passed successfully.
  • I have run linters and fixed any issues.
  • I have checked for any potential security issues or vulnerabilities.

Screenshots (if applicable)

  1. Confirmed that ">[!n" works as expected when entered.
    image1
    image2

  2. Confirmed that when entering ">[!", there is no line break and works as expected.
    image3
    image4

  3. In the case of ">[! ", since \w follows in the regular expression, spaces were not considered.

  4. Additionally, in the case of "```ad-", where the cursor was after the -, we adjusted it to move to the end of the text.
    image5

(before)
image6

(after)
image7

Additional Notes

This is my second time creating a Pull requests, so it might not be perfect.
If I made any mistakes, I would appreciate it if you could let me know.
Thank you. 🍭

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

Successfully merging this pull request may close these issues.

🐞 Strange Behavior of Callout Type Autocompletion
1 participant