summaryrefslogtreecommitdiffstats
path: root/autoload/dart.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2017-09-27 19:57:29 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2017-09-27 19:57:29 +0200
commit8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8 (patch)
tree125734ac66307a962eeda16283355dde0d0fbd2e /autoload/dart.vim
parent9bfde7574aa89a91b80ed9c993fc000cfc11aae7 (diff)
downloadvim-polyglot-8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8.tar.gz
vim-polyglot-8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8.zip
Update
Diffstat (limited to 'autoload/dart.vim')
-rw-r--r--autoload/dart.vim8
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:]