google / vimdoc

Helpfile generation for vim
Apache License 2.0
291 stars 28 forks source link

Avoid extra blank output lines between consecutive vimscript examples #129

Open dbarnett opened 1 year ago

dbarnett commented 1 year ago

I noticed vimdoc outputs some ugly extra blank lines between consecutive vimscript examples if you have something like:

""
" Example: >
"   call Foo()
" < >
"   call Bar()
" <

Actual output:

Example: >
  call Foo()
<

>
  call Bar()
<

Expected output:

Example: >
  call Foo()
< >
  call Bar()
<

The vim helpfile syntax does seem to detect those correctly as code examples and highlight both.

dbarnett commented 1 year ago

Note: It's not going to be very common to have multiple consecutive code examples like that since you could just combine them into one. In my case I wanted examples of just an if statement w/o the clutter of a body and closing endif, so I felt it would be a little confusing to just combine them into one code block, and too wordy to try include the endifs:

if Foo()
if Bar()