File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ function! codefmt#clangformat#GetFormatter() abort
171171 let l: result = maktaba#syscall#Create (l: cmd ).WithStdin (l: input ).Call ()
172172 let l: formatted = split (l: result .stdout, " \n " )
173173
174- if l: supports_cursor
174+ if l: supports_cursor && ! ( line ( ' $ ' ) == 1 && getline ( 1 ) == ' ' )
175175 " With -cursor, the first line is a JSON object.
176176 let l: header = remove (l: formatted , 0 )
177177 call maktaba#buffer#Overwrite (1 , line (' $' ), l: formatted )
@@ -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 )
You can’t perform that action at this time.
0 commit comments