google / vim-codefmt

Vim plugin for syntax-aware code formatting
Apache License 2.0
1.11k stars 114 forks source link

when I use formatcode clang-format it shows such errors #155

Closed zjbbuaa closed 4 years ago

zjbbuaa commented 4 years ago

error detected while processing function 38_FormatBufferAndSetRepeat..codefmt#FormatBuffer..43_GetFormatter ..43_IsAvailable..12..codefmt#formatterhelpers#ResolveFlagToArray:

dbarnett commented 4 years ago

Is that the whole error you saw? That's just the call stack trace but after the colon it should say what the error was.

It's something about the values you have configured for flags but I don't know which flag or what value it had from just that line of error output. If you can make sure you have https://github.com/google/vim-glaive installed and execute :Glaive codefmt in your vim and share the output, that could give some clues too.

zjbbuaa commented 4 years ago

when I execute :Glavie codefmt image It means it is ok with clang-format but when I execute format-code clang-format image

zjbbuaa commented 4 years ago

can any one can help me?

dbarnett commented 4 years ago

Ah, looks like you're running a fairly old version of vim older than 7.4.1546. #158 should fix that, and improve error messages for any other similar errors that may come up.