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

Improve moving header commands in GFM #41

Closed
wants to merge 1 commit into from

Conversation

syohex
Copy link
Collaborator

@syohex syohex commented Dec 9, 2015

Ignore header like statements in code blocks.

I suppose this patch fixes #33 issue. Please review.

markdown-mode

Ignore header like statements in code blocks.
@jrblevin
Copy link
Owner

Many thanks for this patch. It works for moving between the previous/next headers (of any level), but not yet for moving between headers of the same level (for example, if at level 2, it skip any 3+ headers and move to the next level 2). This gave me some ideas for rewriting the other outline-mode function, so haven't committed it yet, but I hope to work it in as part of a broader patch soon.

@jrblevin
Copy link
Owner

I'm also working on test cases, etc., and I had one possible concern: I wonder if there might be some unexpected consequences of setting code blocks to be level 7 in the markdown-outline-level function. I understand the basic logic, since there are at most six levels of ATX-style headings, but this function is also called by some of the font lock and block movement commands. I want to test it a bit more.

@syohex
Copy link
Collaborator Author

syohex commented Dec 13, 2015

but not yet for moving between headers of the same level (for example, if at level 2, it skip any 3+ headers and move to the next level)

Please tell me what's wrong in more detail. I suppose this patched version commands works like such behaviour.

@jrblevin
Copy link
Owner

In other words, the patch works for markdown-next-visible-heading and markdown-previous-visible-heading but not for outline-forward-same-level and outline-backward-same-level. Thank you for the patch, but rather the commit a partial fix I am working on a larger rewrite of the code block parsing functions that should improve font lock, heading folding, heading movement, etc. with respect to headers inside code blocks. My plan is to mark code blocks at the syntax analysis stage and then in the font lock and movement stages, we can simply look at the syntax properties rather than rescanning the document for all code blocks. Stay tuned...

@jrblevin jrblevin closed this Dec 15, 2015
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.

Lines beginning with hash symbol in literal code blocks treated as headers
2 participants