package publish
This commit is contained in:
parent
88c8ebbd3e
commit
551edb1a82
1 changed files with 8 additions and 11 deletions
|
@ -28,6 +28,13 @@ setlocal commentstring=(*\ %s\ *)
|
||||||
" use patscc as a checker
|
" use patscc as a checker
|
||||||
let g:syntastic_ats_checkers = [ 'patscc' ]
|
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 to format our buffer
|
||||||
function! AtsFormat()
|
function! AtsFormat()
|
||||||
let cursor = getpos('.')
|
let cursor = getpos('.')
|
||||||
|
@ -35,6 +42,7 @@ function! AtsFormat()
|
||||||
exec 'silent !atsfmt -i ' . expand('%')
|
exec 'silent !atsfmt -i ' . expand('%')
|
||||||
exec 'e'
|
exec 'e'
|
||||||
call setpos('.', cursor)
|
call setpos('.', cursor)
|
||||||
|
call ATSStripTrailingWhitespce()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if g:ats_use_ctags == 1
|
if g:ats_use_ctags == 1
|
||||||
|
@ -50,17 +58,6 @@ if g:ats_autoformat == 1
|
||||||
augroup END
|
augroup END
|
||||||
endif
|
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
|
" commands
|
||||||
command! -nargs=0 Format call AtsFormat()
|
command! -nargs=0 Format call AtsFormat()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue