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

Folding breaks on particular .md file #41

Open
frankitox opened this issue Jul 29, 2020 · 1 comment
Open

Folding breaks on particular .md file #41

frankitox opened this issue Jul 29, 2020 · 1 comment

Comments

@frankitox
Copy link

Hi! I just encountered a problem when folding, if I have the following markdown
in a file:

# First

```
1
2
3
4
5

7
```

first

* first
* second
* third

# Second

second

Then when I close the fold it 'eats' the second heading. So it goes from

image

to

image

Let me know if you can reproduce it. I tried only loading this plugin but
the issue persists. I'm using nvim if that helps.

NVIM v0.4.3
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/include
Compiled by travis@travis-job-9a287301-34f2-4b86-92e3-462594f51f36

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/home/travis/build/neovim/bot-ci/build/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info
@frankitox
Copy link
Author

frankitox commented Jul 29, 2020

Alright, from what I could found the problem is it interprets the second title as inside fences. Apparently HasSyntaxGroup is what doesn't work properly

if exists("b:current_syntax") && b:current_syntax ==# 'markdown'
" It's cheap to check if the current line has 'markdownCode' syntax group
return HasSyntaxGroup(a:lnum, '\vmarkdown(Code|Highlight)')

As a workaround I simply added to my ~/.vimrc:

autocmd FileType markdown let b:current_syntax=''

Other solution is to add tpope's markdown plugin. tpope's plugin breaks in other places.

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

No branches or pull requests

1 participant