-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fold import, var, and const blocks (#1339)
* Fold import, var, and const blocks This adds `foldmethod=syntax` folding for `import`, `var`, and `const` blocks. I added a new `g:go_fold_enable` setting to selectively enable which regions get folded. I find this useful personally as I only want to fold `import` blocks. Future extension to this might be: - `struct` and `interface`, to selectively fold `type foo struct { .. }` and `type foo interface { .. }` definitions; - `package`, to fold the package-level comment. But that's another PR for another day ;-) Fixes: #963
- Loading branch information
Showing
2 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d5f5505
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One issue with this change is that it changes
package
andimport
to Statements, which almost no colorschemes have color for. I changed them back to Keyword locally to fix that.d5f5505
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I follow what you mean @evanphx? They were always
Statement
? Previously it was:d5f5505
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh strange. Yes yes, I must be something elsewhere! Sorry about that!