Skip to content

Commit adb2804

Browse files
committed
Echo a maktaba-formatted error if clang-format output is unparseable.
This is needed in order to effectively unit-test against the situation in which clang-format produces no output. In this case, there is a JSON parsing error (since there isn't any JSON to parse). By using a formatted error here, vroom is able to bail out when the error is not handled properly. Signed-off-by: Wolfgang E. Sanyer <WolfgangSanyer@Google.com>
1 parent 605dc00 commit adb2804

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

autoload/codefmt/clangformat.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ function! codefmt#clangformat#GetFormatter() abort
182182
let [l:new_line, l:new_col] = s:OffsetToPosition(l:offset, l:formatted)
183183
call cursor(l:new_line, l:new_col)
184184
catch
185-
call maktaba#error#Warn('Unable to parse clang-format cursor pos: %s',
186-
\ v:exception)
185+
call maktaba#error#Warn(v:exception)
186+
call maktaba#error#Warn(" Unable to parse clang-formon cursor position")
187187
endtry
188188
else
189189
call maktaba#buffer#Overwrite(1, line('$'), l:formatted)

0 commit comments

Comments
 (0)