vimdoc icon indicating copy to clipboard operation
vimdoc copied to clipboard

Don't wrap long lines in literal blocks

Open dantleech opened this issue 5 years ago • 2 comments

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?

dantleech avatar Mar 09 '20 22:03 dantleech

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.

dbarnett avatar Mar 10 '20 05:03 dbarnett

Ah, good suggestion, thanks :)

dantleech avatar Mar 10 '20 09:03 dantleech