Skip to content

Commit ead2193

Browse files
LemonBoyhaze
authored andcommitted
Fallback for old Vim versions
1 parent fcafb4b commit ead2193

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

autoload/zig/fmt.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ function! zig#fmt#Format() abort
2727
try | silent undojoin | catch | endtry
2828

2929
" Replace the file content with the formatted version.
30-
call deletebufline(current_buf, len(out), line('$'))
30+
if exists('*deletebufline')
31+
call deletebufline(current_buf, len(out), line('$'))
32+
else
33+
silent execute ':' . len(out) . ',' . line('$') . ' delete _'
34+
endif
3135
call setline(1, out)
3236

3337
" No errors detected, close the loclist.

0 commit comments

Comments
 (0)