From 551edb1a82e84deae9b2f758c5a4dc81f0ce2993 Mon Sep 17 00:00:00 2001 From: Vanessa McHale Date: Fri, 1 Mar 2019 20:22:54 -0600 Subject: [PATCH] package publish --- ftplugin/ats.vim | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/ftplugin/ats.vim b/ftplugin/ats.vim index 8b430c9..1543d8b 100644 --- a/ftplugin/ats.vim +++ b/ftplugin/ats.vim @@ -28,6 +28,13 @@ setlocal commentstring=(*\ %s\ *) " use patscc as a checker let g:syntastic_ats_checkers = [ 'patscc' ] +function! ATSStripTrailingWhitespace() + let myline=line('.') + let mycolumn = col('.') + exec 'silent %s/ *$//' + call cursor(myline, mycolumn) +endfunction + " function to format our buffer function! AtsFormat() let cursor = getpos('.') @@ -35,6 +42,7 @@ function! AtsFormat() exec 'silent !atsfmt -i ' . expand('%') exec 'e' call setpos('.', cursor) + call ATSStripTrailingWhitespce() endfunction if g:ats_use_ctags == 1 @@ -50,17 +58,6 @@ if g:ats_autoformat == 1 augroup END endif -function! StripTrailingWhitespace() - let myline=line('.') - let mycolumn = col('.') - exec 'silent %s/ *$//' - call cursor(myline, mycolumn) -endfunction - -augroup ats - au BufWritePost *.dats,*.sats,*.hats silent! call StripTrailingWhitespace() -augroup END - " commands command! -nargs=0 Format call AtsFormat()