FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Include empty lines in folds · Issue #397 · vim-ruby/vim-ruby · GitHub

Repository navigation

Include empty lines in folds #397

Description

When I enable folds with foldmethod=syntax, all the methods are being fold strictly over the method:

def foo
  puts "foo"
end

def bar
  puts "bar"
end

def foobar
  puts "foobar"
end

becomes:

+---  3 lines: def foo····································

+---  3 lines: def bar····································

+---  3 lines: def foobar·································

what would be nice would it to have the folds eagerly include the extra space after the fold, so that we could have instead:

+---  3 lines: def foo····································
+---  3 lines: def bar····································
+---  3 lines: def foobar·································

which can be obtained by removing empty lines between method, but that's bad practice, and as I navigate within vim with {/} a lot, I got to keep it :)

Maybe this could be configured as a preference?

Thank you for the good work ♥

Activity

  1. dkearns commented on Apr 4, 2019

    Member

    This seems like something that would be better done at a more general level with a plugin that removes whitespace between fold regions.

    It also has unacceptable ramifications for any other code expecting end to end at the end of end and for color schemes that highlight the background specifically for that syntax group.

    To deal with your specific issue, however, you can add something like the following to your ~/.vim/after/syntax/ruby.vim

    syn region rubyMethodBlockFold start="\<def\>" end="\<end\_s*\n" contains=rubyMethodBlock keepend transparent fold

  2. guyzmo commented on Apr 6, 2019

    Author

    thank you for the tip, maybe could such a line be enabled within ruby.vim with a config option, to fit all situations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL