Open rpdelaney opened 5 years ago
My apologies for the delay.
Thanks for the nice writeup and use-case @rpdelaney
I'll try and set aside some time to look at this. If you come up with a PR that addresses it I'll happily merge it.
quick note for future me:
As the title suggests, the problem is essentially that it's not ignoring headings contained in code fences.
eg
```
# cryptsetup luksFormat --type luks1 --use-random --hash whirlpool --iter-time 5000 /dev/nvme0n1p2
```
@masukomi Any progress on this?
Also experiencing this issue and would love a fix! Thanks for a great plugin @masukomi 🙂
@wesrer just haven't gotten around to working on this. Will happily accept PRs (cc @noperator ) ;)
Strangely, I'm encountering this issue a bit inconsistently. I tried to reproduce @rpdelaney's example above by downloading the file as is, and opening it in vim.
wget https://raw.githubusercontent.com/rpdelaney/iris-setup/a73f04ab1d0d0cc587d40893af2bf48c7eb81ba7/PRE_OS.md
vim PRE_OS.md
Here's what I'm seeing:
# Pre-OS prep [17 lines]-----------------------
## Installation media [13 lines]-----------------------
## Create partitions [12 lines]-----------------------
## Create LUKS container [9 lines]------------------------
## O/S Filesystem [7 lines]------------------------
### Create and mount LVM volumes [14 lines]-----------------------
### Create btrfs filesystem [63 lines]-----------------------
## O/S [4 lines]------------------------
I'll report back here if I can reproduce an octothorpe within fenced code blocks that breaks folding.
I noticed that wherever leading octothorpes inside fenced code blocks were interpreted by this plugin as a header, those lines were also highlighted as headers—i.e., for some reason, Vim's included syntax highlighting wasn't recognizing those lines as being inside of a code block. That's likely the root issue here since this plugin's folding.vim
, in turn, relies on the aforementioned syntax highlighting to determine whether a given line is inside of a code block or not:
https://github.com/masukomi/vim-markdown-folding/blob/3f35acfb753cc9ea22182400b075c5b6e896ad71/after/ftplugin/markdown/folding.vim#L67-L76
I think I solved this issue (in my case, at least) by following some guidance from tpope/vim-markdown
(Vim's included syntax highlighting):
Syntax highlight is synchronized in 50 lines. It may cause collapsed highlighting at large fenced code block. In the case, please set larger value in your vimrc:
let g:markdown_minlines = 100
Note that setting too large value may cause bad performance on highlighting.
I kept increasing g:markdown_minlines
until this problem went away (i.e., until the folded headers looked right), settling at 1000
with no recognizable performance issues. Here's my .vimrc
for your reference; masukomi/vim-markdown-folding
is the only plugin I'm using, installed with Vim's native package loading.
This looks very much along the lines of #1. Possibly related to #6 also (but I kinda doubt it).
Using vim-markdown-folding with vim-plug, on 3f35acfb753cc9ea22182400b075c5b6e896ad71. I'm observing a problem when editing this file I'm working on.
Looks like this:
I would expect something more like this (maybe with different counts of folded lines):