google / vimdoc

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

Don't wrap long lines in literal blocks #111

Open dantleech opened 4 years ago

dantleech commented 4 years ago

Hi, thanks for this tool :)

We are trying to include some example mappings in the documentation:

" Phpactor does not assume any mappings automatically, the following mappings
" are available for you to copy: >
"
"   augroup PhpactorMappings
"     au!
"     ...
"     au FileType php nmap <buffer> <Leader>cc :PhpactorClassNew<CR>
"     au FileType php nmap <buffer> <silent> <Leader>ee :PhpactorExtractExpression<CR>
"     au FileType php vmap <buffer> <silent> <Leader>ee :<C-u>PhpactorExtractExpression<CR>
"     au FileType php vmap <buffer> <silent> <Leader>em :<C-u>PhpactorExtractMethod<CR>
"   augroup END
" <

But the longer lines wrap:

    au FileType php nmap <buffer> <Leader>cc :PhpactorClassNew<CR>
    au FileType php nmap <buffer> <silent> <Leader>ee
    :PhpactorExtractExpression<CR>
    au FileType php vmap <buffer> <silent> <Leader>ee
    :<C-u>PhpactorExtractExpression<CR>
    au FileType php vmap <buffer> <silent> <Leader>em
    :<C-u>PhpactorExtractMethod<CR>

Is it / can it be possible to disable wrapping in > < blocks?

dbarnett commented 4 years ago

Agreed, looks like a bug that those are wrapping. Literal blocks are supported but apparently don't override the normal text wrapping.

As a workaround, consider just using line continuations and keeping the lines below standard column width so they don't overflow:

" are available for you to copy: >
"
"   augroup PhpactorMappings
"     au!
"     ...
"     au FileType php nmap <buffer> <Leader>cc :PhpactorClassNew<CR>
"     au FileType php nmap <buffer> <silent> <Leader>ee
"         \ :PhpactorExtractExpression<CR>
"     au FileType php vmap <buffer> <silent> <Leader>ee
"         \ :<C-u>PhpactorExtractExpression<CR>
"     au FileType php vmap <buffer> <silent> <Leader>em
"         \ :<C-u>PhpactorExtractMethod<CR>
"   augroup END
" <

That's better style anyway.

dantleech commented 4 years ago

Ah, good suggestion, thanks :)