pseewald / vim-anyfold

Language agnostic vim plugin for folding and motion based on indentation.
MIT License
268 stars 11 forks source link

Does not seem to work with yaml #29

Closed nkakouros closed 4 years ago

nkakouros commented 4 years ago

Thanks for this plugin.

This is how I have anyfold configured:

  " Minimalistic display of closed folds
  let g:anyfold_fold_display = 1

  " Fold multiline comments
  let g:anyfold_fold_comments = 1
  let g:anyfold_identify_comments = 2
  let g:anyfold_comments = []

I am trying to have folds in yaml files based on indent. The following file:

- dfdfdf: 223
  dfdf: 23423
  sdfsdf:
    sdfsdf: 1232
    sdfsdf: 1232
    sdfsdf: 1232
  sdfsdf:
    sdfsdf: 1232
    sdfsdf: 1232
    sdfsdf: 1232

however produces a single fold with anyfold that folds the whole file. I would expect it to produce two more folds on the inner indents. Am I doing sth wrong? Is this by design? Can I somehow enable the inner folds as well?

pseewald commented 4 years ago

Thanks for reporting, this should be fixed in 3ed5d8ccbf0f5031f7c7d2be05aa7ddb4550dc5c

The empty list let g:anyfold_comments = [] was causing zero-length matches (thus identifying every line as a comment line). Now everything should work as expected.