Commit 47a10a7
committed
Make style lookup consistent with clang-format
The current version was using -style=file option only,
causing failure if pwd != file's directory.
2 kinds of failures occur:
- If no .clang-format is present in PWD, and one is
present in the file's directory, then clang-format
fails for lack of style file, and dump its error message
directly into the buffer
- If a .clang-format is present in PWD, and one is present
in the file's directory, then the wrong .clang-format from PWD is used
This commit makes the behavior fully consistent with clang-format:
- lookup .clang_format in the file's directory and recursively go up
its parent directory until found. If no style file is found, defaults
to g:clang_format#style_options1 parent d90af92 commit 47a10a7
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | | - | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
0 commit comments