GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Include empty lines in folds · Issue #397 · vim-ruby/vim-ruby

Include empty lines in folds #397

New issue
Copy link
New issue
Copy link
Open
Open
Include empty lines in folds#397
Copy link
Labels
syntax

Description

@guyzmo
guyzmo
opened on Mar 29, 2019
Issue body actions

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

    @dkearns
    dkearns
    on Apr 4, 2019
    Member
    More actions

    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. dkearns
    added
    syntax
    on Apr 4, 2019
  3. guyzmo commented on Apr 6, 2019

    @guyzmo
    guyzmo
    on Apr 6, 2019
    Author
    More actions

    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

    syntax

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.