This commit is contained in:
Adam Stankiewicz
2021-03-10 17:22:05 +01:00
parent cc63193ce8
commit eda351ca89
21 changed files with 490 additions and 101 deletions

View File

@@ -31,7 +31,11 @@ function! zig#fmt#Format() abort
try | silent undojoin | catch | endtry
" Replace the file content with the formatted version.
call deletebufline(current_buf, len(out), line('$'))
if exists('*deletebufline')
call deletebufline(current_buf, len(out), line('$'))
else
silent execute ':' . len(out) . ',' . line('$') . ' delete _'
endif
call setline(1, out)
" No errors detected, close the loclist.