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

Bug: # is treated as a heading when it is in a code block #145

Closed
sragons opened this issue May 5, 2023 · 1 comment
Closed

Bug: # is treated as a heading when it is in a code block #145

sragons opened this issue May 5, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sragons
Copy link

sragons commented May 5, 2023

Hello,
The caractere '#' is considere like a title when it is present in a code section.

Exemple:

`# Test

# Exemple
exemple de code en markdown

In the code section, '#Exemple' is considere like a title:

  • when you navigate with ']]'
  • when you use folding fonctionality

Thank you

@jakewvincent jakewvincent self-assigned this May 11, 2023
@jakewvincent jakewvincent added the enhancement New feature or request label May 11, 2023
@jakewvincent jakewvincent changed the title Do not considere '#' as a title when '#' is in code tag Feature: Do not consider # as a title when # is in code tag Oct 25, 2023
@jakewvincent jakewvincent added bug Something isn't working and removed enhancement New feature or request labels Jun 3, 2024
@jakewvincent jakewvincent changed the title Feature: Do not consider # as a title when # is in code tag Bug: # is treated as a heading when it is in a code block Jun 3, 2024
jakewvincent added a commit that referenced this issue Jun 3, 2024
- Addresses issue #145
- Fixes folding and jump-to-section behavior
- If folding or jump-to-section is initiated with the cursor IN a code
  block, the behavior will occur in the code block itself (i.e. the
  cursor will jump to the next heading inside the code block, if there
  is one, or it will fold the section inside of the code block)
@jakewvincent
Copy link
Owner

@sragons this should be fixed in the latest. Thanks, and sorry for the awfully long delay.

jakewvincent added a commit that referenced this issue Jun 5, 2024
This fix is related to issue #145. A new utility function is added which
checks whether the cursor is currently inside of a code block by
counting the instances of backticks before or after the cursor in the
buffer. If the cursor is in a code block, any headings (or things that
resemble headings, such as comments introduced by #) are ignored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants