1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:30:05 +08:00

Update format function (#4265)

This commit is contained in:
Wang Shidong 2021-05-20 06:42:51 +08:00 committed by GitHub
parent a8d7faf4af
commit ee730ef00d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,12 @@ endfunction
function! s:format() abort
if !empty(&ft) &&
\ ( index(s:format_ft, &ft) !=# -1 || s:format_on_save ==# 1)
try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | finally | silent Neoformat | endtry
try
undojoin
Neoformat
catch /^Vim\%((\a\+)\)\=:E790/
finally
silent Neoformat
endtry
endif
endfunction