diff options
Diffstat (limited to 'autoload/dart.vim')
-rw-r--r-- | autoload/dart.vim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/autoload/dart.vim b/autoload/dart.vim index 9f04fcc2..76013172 100644 --- a/autoload/dart.vim +++ b/autoload/dart.vim @@ -24,9 +24,11 @@ function! dart#fmt(q_args) abort let joined_lines = system(printf('dartfmt %s', a:q_args), buffer_content) if 0 == v:shell_error let win_view = winsaveview() - silent % delete _ - silent put=joined_lines - silent 1 delete _ + let lines = split(joined_lines, "\n") + silent keepjumps call setline(1, lines) + if line('$') > len(lines) + silent keepjumps execute string(len(lines)+1).',$ delete' + endif call winrestview(win_view) else let errors = split(joined_lines, "\n")[2:] |