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

Add Code Folding Support #145

Open
xanderdunn opened this issue Jul 26, 2020 · 3 comments
Open

Add Code Folding Support #145

xanderdunn opened this issue Jul 26, 2020 · 3 comments

Comments

@xanderdunn
Copy link

xanderdunn commented Jul 26, 2020

I just installed swift.vim in neovim 0.4.3. My swift files compile and run fine in Swift version 5.3-dev (LLVM 55d27a5828, Swift 6a5d84ec08).

But vim doesn't find any folds in my swift files. When I press one of the commands to open or close folds, such as zO or zc, I see the error E490: No fold found. This is unusual. Most languages have code folding support in vim.

@keith
Copy link
Owner

keith commented Jul 26, 2020

What is required to make this work?

@xanderdunn
Copy link
Author

xanderdunn commented Jul 26, 2020

This swift plugin for vim, which hasn't been updated since 2015, indicates that it supports code folding. I haven't created a language plugin for vim before, I'm looking through it to see where the folding support comes in. I can't imagine it would be much different from C++ code folding, but I'm also new to Swift.

  • It looks like this is the declaration that the plugin supports code folding
  • My best guess is that the fold keywords peppered throughout this file indicate to Swift what to start and end folds on.
  • Here is the documentation on the option to disable code folding.

@keith
Copy link
Owner

keith commented Jul 28, 2020

Happy to accept PRs for this but I likely won't get to it

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

2 participants