Failed to format part of the code with clang-format
onlycalm opened this issue · comments
Calm commented
The configuration of .vimrc is as follows:
"vim-autoformat/vim-autoformat
let g:formatdef_clangformat_google = '"clang-format -style google -"'
let g:formatters_c = ['clangformat_google']
let g:autoformat_autoindent = 0
let g:autoformat_retab = 0
let g:autoformat_verbosemode = 1
let g:autoformat_remove_trailing_spaces = 1
Methods of reproducing problems:
- Select a code block in visual mode and execute instructions
:Autoformat
. - Execute Instructions
AutoformatLine
.
It will format the entire C file, rather than just part of the code block.
chtenb commented
Look at the default definition to see how to pass the range arguments to clang.