vimdoc icon indicating copy to clipboard operation
vimdoc copied to clipboard

Avoid extra blank output lines between consecutive vimscript examples

Open dbarnett opened this issue 2 years ago • 1 comments

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 avatar Mar 18 '23 21:03 dbarnett

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()

dbarnett avatar Mar 18 '23 22:03 dbarnett