mirror of
https://github.com/google/vim-jsonnet.git
synced 2026-01-22 10:31:47 +01:00
fix: maintain view/folds when formatting on save (#31)
This commit is contained in:
parent
6ac3486c47
commit
c2a3e8ca00
@ -105,9 +105,11 @@ function! jsonnet#Format()
|
||||
call setfperm(expand('%'), l:originalFPerm)
|
||||
endif
|
||||
" the file has been changed outside of vim, enable reedit
|
||||
mkview
|
||||
silent edit!
|
||||
let &fileformat = l:originalFileFormat
|
||||
let &syntax = &syntax
|
||||
silent loadview
|
||||
elseif g:jsonnet_fmt_fail_silently == 0
|
||||
" FixMe: We could leverage the errors coming from the `jsonnetfmt` and
|
||||
" give immediate feedback to the user at every save time.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user