tpope / vim-markdown

Vim Markdown runtime files
1.22k stars 191 forks source link

Fix fold inside code fences, again #199

Closed flyxyz123 closed 1 year ago

flyxyz123 commented 1 year ago

Fix https://github.com/tpope/vim-markdown/issues/161 and https://github.com/tpope/vim-markdown/issues/177 (again)

I recently find that this issue https://github.com/tpope/vim-markdown/issues/177 still exists. My old pull request https://github.com/tpope/vim-markdown/pull/178 to fix this issue doesn't work anymore.

The problem is still here: https://github.com/tpope/vim-markdown/blob/feadbc81e27f277187c29957ec6114f1e95f2162/ftplugin/markdown.vim#L38

After some debugging, I find that replace markdownCode with markdownCodeBlock works, as code suggestions from https://github.com/tpope/vim-markdown/issues/161. The weird thing is in the past, codes inside three backticks are parsed as markdownCode. It seems incorrect but I never think more about it. I think that's why our old codes uses markdownCode instead of markdownCodeBlock. But now, it is parsed as markdownCodeBlock. I have no idea why it parsed differently in the past. Good news is markdownCodeBlock seems more correct than markdownCode.